input value
integer power
base
rounded value
// Round a value to 4 decimal places:
var v = floorb( 3.141592653589793, -4, 10 );
// returns 3.1415
// If n = 0 or b = 1, `floorb` behaves like `floor`:
var v = floorb( 3.141592653589793, 0, 2 );
// returns 3.0
// Round a value to the nearest multiple of two toward negative infinity:
var v = floorb( 5.0, 1, 2 );
// returns 4.0
Rounds a numeric value to the nearest multiple of \(b^n\) toward negative infinity.
Notes