aureooms-js-number
Version:
Primitive number type arithmetic for JavaScript
24 lines (15 loc) • 356 B
JavaScript
import test from 'ava' ;
import * as number from '../../../../src' ;
test( "pow2" , t => {
const one = function ( a ) {
t.deepEqual( number.pow2( a ) , a * a , a + " * " + a ) ;
} ;
const n = 10 ;
for ( let i = 0 ; i < n ; ++i ) {
const a = Math.random( ) ;
one( a ) ;
}
one( Infinity ) ;
one( 0 ) ;
one( -Infinity ) ;
} ) ;