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( "shr" , 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.shr( a , b ) , a >> b , a + " >> " + b ) ; } } ) ;