UNPKG

aureooms-js-number

Version:

Primitive number type arithmetic for JavaScript

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