nexttoward


nexttoward

Obtains the next representable value in the direction of a given long double value

 #include <math.h> double nexttoward ( double x , long double y  ); float nexttowardf ( float x , long double y  ); long double nexttowardl ( long double x , long double y  ); 

The nexttoward( ) functions are similar to nextafter( ), except that the second parameter in all three variants has the type long double.

Example

 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 

See Also

nextafter( ), nearbyint( ), rint( ), lrint( ), llrint( ), round( ), lround( ), llround( ), ceil( ), floor( )



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