round


round

Rounds a floating-point number to an integer value

 #include <math.h> double round ( double x  ); float roundf ( float x  ); long double roundl ( long double x  ); 

The round( ) functions round a floating-point number to the nearest integer value, regardless of the current rounding direction setting in the floating-point environment. If the argument is exactly halfway between two integers, round( ) rounds it away from 0. The return value is the rounded integer value.

Example

See the example for nearbyint( ) in this chapter.

See Also

lround( ), llround( ), rint( ), lrint( ), llrint( ), nearbyint( ), nexttoward( ), nextafter( ); ceil( ), trunc( )



C(c) In a Nutshell
C in a Nutshell (In a Nutshell (OReilly))
ISBN: 0596006977
EAN: 2147483647
Year: 2006
Pages: 473

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net