UNPKG

aureooms-js-number

Version:

Primitive number type arithmetic for JavaScript

24 lines (14 loc) 360 B
import test from 'ava' ; import * as number from '../../../../src' ; test ( "idiv2" , assert => { const one = function ( n ) { let x = n ; assert.deepEqual ( number . idiv2 ( x ) , n /= 2 , x + " /= " + 2 ) ; } ; const n = 10 ; for ( let i = 0 ; i < n ; ++i ) { one ( Math . random ( ) ) ; } one ( Infinity ) ; one ( -Infinity ) ; } ) ;