Ceil

Round a numeric value toward positive infinity.

Usage

var ceil = require( '@stdlib/math/base/special/ceil' );

ceil( x )

Rounds a numeric value toward positive infinity.

var v = ceil( -4.2 );
// returns -4.0

v = ceil( 9.99999 );
// returns 10.0

v = ceil( 0.0 );
// returns 0.0

v = ceil( NaN );
// returns NaN

Examples

var randu = require( '@stdlib/random/base/randu' );
var ceil = require( '@stdlib/math/base/special/ceil' );

var x;
var i;

for ( i = 0; i < 100; i++ ) {
    x = (randu()*100.0) - 50.0;
    console.log( 'ceil(%d) = %d', x, ceil( x ) );
}