aureooms-js-number
Version:
Primitive number type arithmetic for JavaScript
26 lines (14 loc) • 362 B
JavaScript
import test from 'ava' ;
import * as number from '../../../../src' ;
test ( "isub1" , assert => {
const one = function ( n ) {
let x = n ;
assert.deepEqual ( number . isub1 ( x ) , n -= 1 , x + " -= " + 1 ) ;
} ;
const n = 10 ;
for ( let i = 0 ; i < n ; ++i ) {
one ( Math . random ( ) ) ;
}
one ( Infinity ) ;
one ( -Infinity ) ;
} ) ;