Skip to content

Commit c694f62

Browse files
test comparison of integer in different bases
1 parent b92eb2d commit c694f62

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import test from 'ava' ;
2+
3+
import { IntegerRing } from '../../../src' ;
4+
5+
test( 'different bases' , t => {
6+
7+
const R = new IntegerRing( 'R' , 10 ) ;
8+
const S = new IntegerRing( 'R' , 2 ) ;
9+
10+
const r = R.from( [ 0 , 7 ] ) ;
11+
const s = S.from( [ 0 , 1 , 1 , 0 , 1 ] ) ;
12+
13+
t.is( r.cmp(s) , 1 ) ;
14+
t.is( r.cmp(r) , 0 ) ;
15+
t.is( s.cmp(r) , -1 ) ;
16+
t.is( s.cmp(s) , 0 ) ;
17+
18+
} ) ;

0 commit comments

Comments
 (0)