File: nthroot.mpt

package info (click to toggle)
mathpiper 0.81f%2Bsvn4469%2Bdfsg3-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 36,572 kB
  • sloc: java: 57,479; lisp: 13,721; objc: 1,300; xml: 988; makefile: 114; awk: 95; sh: 38
file content (28 lines) | stat: -rw-r--r-- 936 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//////
// $Id: nthroot.yts,v 1.3 2006/03/26 12:49:15 ayalpinkus Exp $
// tests for NthRoot
//////

Testing("-- NthRoot");

// you need to use ListToFunction for this one as -1 is actually -(1), eg. a unary function (minus)
// applied to a positive integer (1). ListToFunction evaluates its arguments, resulting in a negative
// integer (-1).
Verify(NthRoot(-1,2),ListToFunction({NthRoot,-1,2}));

Verify(NthRoot(2,1),Hold(NthRoot(2,1)));
Verify(NthRoot(2,2),{1,2});
Verify(NthRoot(12,2),{2,3});
Verify(NthRoot(12,3),{1,12});
Verify(NthRoot(27,3),{3,1});
Verify(NthRoot(17*13,2),{1,17*13});
Verify(NthRoot(17*17*13,2),{17,13});
Verify(NthRoot(17*17*17*13,2),{17,17*13});
Verify(NthRoot(17*17*17*13,3),{17,13});
Verify(NthRoot(17*17*17*17*13*13,2),{17*17*13,1});
Verify(NthRoot(17*17*17*17*13*13,3),{17,17*13*13});
Verify(NthRoot(17*17*17*17*13*13,4),{17,13*13});
Verify(NthRoot(17*17*17*17*13*13,5),{1,17*17*17*17*13*13});

//////
//////