File tree 1 file changed +22
-0
lines changed
1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -31,4 +31,26 @@ test( macro ,
31
31
ZZ . from ( '52310721570994454309603316505452077132504750494613585448247191340916543146521771411345313270814742631' )
32
32
) ;
33
33
34
+ function auto ( t , a ) {
35
+ t . is ( a . abs ( ) . toString ( ) , a . gcd ( a ) . toString ( ) ) ;
36
+ }
37
+
38
+ auto . title = ( providedTitle , a ) => `auto gcd(${ a . toString ( ) } ,${ a . toString ( ) } ) = ${ a . toString ( ) } ` ;
39
+
40
+ test ( auto , ZZ . $0 ( ) ) ;
41
+ test ( auto , ZZ . $1 ( ) ) ;
42
+ test ( auto , ZZ . $_1 ( ) ) ;
43
+ test ( auto , ZZ . from ( 2 ) ) ;
44
+ test ( auto , ZZ . from ( 13280123 ) ) ;
45
+ test ( auto ,
46
+ ZZ . from ( '37650526072328171936695291762250209370684337226819795603338569781977444693437332193180866661042770508342415236941382410000000000000000' )
47
+ ) ;
48
+
49
+ test ( auto ,
50
+ ZZ . from ( '-37650526072328171936695291762250209370684337226819795603338569781977444693437332193180866661042770508342415236941382410000000000000000' )
51
+ ) ;
52
+
53
+ test ( macro , ZZ . from ( - 3 ) , ZZ . from ( 3 ) , ZZ . from ( 3 ) ) ;
54
+ test ( macro , ZZ . from ( 3 ) , ZZ . from ( - 3 ) , ZZ . from ( 3 ) ) ;
55
+
34
56
// test generated with https://github.com/aureooms-research/gcd
You can’t perform that action at this time.
0 commit comments