We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d148271 commit 66a8afeCopy full SHA for 66a8afe
test/src/Integer/abs.js
@@ -0,0 +1,18 @@
1
+import test from 'ava' ;
2
+import { ZZ } from '../../../src' ;
3
+
4
+function macro ( t , x ) {
5
+ t.is(x.toString().replace(/-/,''), ZZ.from(x).iabs().toString());
6
+}
7
8
+macro.title = ( providedTitle , x ) => `${x}^2 = ${x*x}` ;
9
10
+test( macro , -1 ) ;
11
+test( macro , 0 ) ;
12
+test( macro , 1 ) ;
13
+test( macro , 2 ) ;
14
+test( macro , 777 ) ;
15
+test( macro , -17321983 ) ;
16
17
+test( macro , '-729482732476982648726149821745982176489127458124719264742194') ;
18
+test( macro , '62393657923765943267853265893279658365') ;
0 commit comments