File: nthroot.mpt

package info (click to toggle)
mathpiper 0.0.svn2556-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 7,416 kB
  • ctags: 2,729
  • sloc: java: 21,643; xml: 751; sh: 105; makefile: 5
file content (28 lines) | stat: -rw-r--r-- 912 bytes parent folder | download | duplicates (3)
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 UnList for this one as -1 is actually -(1), eg. a unary function (minus)
// applied to a positive integer (1). UnList evaluates its arguments, resulting in a negative
// integer (-1).
Verify(NthRoot(-1,2),UnList({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});

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