Name

ceiling, round, trunc, rint, nearbyint — rounding functions

Synopsis

ceiling( in x double precision);
 
round( in x double precision);
 
trunc( in x double precision);
 
rint( in x double precision);
 
nearbyint( in x double precision);
 

Description

These functions round a floating-point value to an integral value according to different rounding modes. They all work with double precision floating point numbers and return a result of that type.

:  ceiling	smallest integer value not less than x (round toward +infinity).
:  round	round x to the nearest integer, halfway cases away from zero.
:  trunc	round x toward zero (drop the fractional part).
:  rint	round x to the nearest integer using the current IEEE 754 rounding direction (raises FE_INEXACT).
:  nearbyint	like rint, but never raises FE_INEXACT.
    

See also floor (round toward -infinity).

Parameters

x

double precision

Return Values

ceiling returns a 32-bit integer.

Examples

Example 24.30. Simple Examples

SQL> select ceiling (12.3456), ceiling (-12.3456), ceiling (0.513513);
callret   callret   callret
INTEGER   INTEGER   INTEGER
_______________________________________________________________________________

13        -12       1

1 Rows. -- 4 msec.
      

See Also

floor


© 1992 - OpenLink Software. All rights reserved.

Making Technology Work for You®