December 2005
Beginner to intermediate
618 pages
20h 19m
English
round
Rounds a floating-point number to an integer value
#include <math.h> doubleround( doublex); floatroundf( floatx); long doubleroundl( long doublex);
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.
See the example for nearbyint() in this
chapter.
lround(), llround(), rint(), lrint(), llrint(), nearbyint(), nexttoward(), nextafter(); ceil(), trunc()
Read now
Unlock full access