December 2005
Beginner to intermediate
618 pages
20h 19m
English
nexttoward
Obtains the next representable value in the direction of a
given long double value
#include <math.h> doublenexttoward( doublex, long doubley); floatnexttowardf( floatx, long doubley); long doublenexttowardl( long doublex, long doubley);
The nexttoward() functions
are similar to nextafter(),
except that the second parameter in all three variants has the type
long double.
float x =nexttowardf( 0.0F, -1E-100L );
printf("The greatest negative floating-point number \n"
"(i.e., the closest to zero) with type float: %E\n", x);This code produces output like the following:
The greatest negative floating-point number (i.e., the closest to zero) with type float: -1.401298E-45
nextafter(), nearbyint(), rint(), lrint(), llrint(), round(), lround(), llround(), ceil(), floor()
Read now
Unlock full access