UNPKG

aureooms-js-number

Version:

Primitive number type arithmetic for JavaScript

18 lines (10 loc) 329 B
import test from 'ava' ; import * as number from '../../../src' ; test( "shl" , t => { const n = 10 ; for ( let i = 0 ; i < n ; ++i ) { const a = Math.floor( Math.random() * Math.pow( 2 , 32 ) ) ; const b = Math.floor( Math.random() * 32 ) ; t.deepEqual( number.shl( a , b ) , a << b , a + " << " + b ) ; } } ) ;