Activity 18.4.
Why might it be useful to have both a
round()
and an lround()
function?#include <math.h>
Function | Prototype | Description |
floor() |
double floor(double x); |
Returns the nearest integer which is less than or equal to the argument passed to this function. |
round() |
double round (double x); |
Returns the nearest integer value of the argument passed to this function. |
lround() |
long lround (double x); |
Returns the nearest integer value of the argument passed to this function. |
ceil() |
double ceil (double x); |
Returns the nearest integer value which is greater than or equal to the argument passed to this function. |
round()
and an lround()
function?