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