|
C(s)C++ Programmer's Reference Authors: Schildt H. Published year: 2002 Pages: 246-253/539 |
#include <math.h>long int lroundf(float arg );long int lround(double arg ); long int lroundl(long double arg );
lround( ) , lroundf( ) , and lroundl( ) were added by C99.
The lround( ) family of functions returns the value of arg rounded to the nearest long integer. Values precisely between two values, such as 3.5, are rounded up.
Related functions are llround ( ) and round( ) .
#include <math.h>float modff(float num , float * i );double modf(double num , double * i ); long double modfl(long double num , long double * i );
modff( ) and modfl( ) were added by C99.
The modf( ) family of functions decomposes num into its integer and fractional parts . The functions return the fractional portion and place the integer part in the variable pointed to by i .
Related functions are frexp( ) and ldexp( ) .
#include <math.h>float nanf(const char * content );double nan(const char * content ); long double nanl(const char * content );
nan( ) , nanf( ) , and nanl( ) were defined by C99.
The nan( ) family of functions returns a value that is not a number and that contains the string pointed to by content .
A related function is isnan ( ) .
#include <math.h>float nearbyintf(float arg );double nearbyint(double arg ); long double nearbyintl(long double arg );
nearbyint( ) , nearbyintf( ) , and nearbyintl( ) were added by C99.
The nearbyint( ) family of functions returns the value of arg rounded to the nearest integer. However, the number is returned as a floating-point value.
Related functions are rint( ) and round( ) .
#include <math.h>float nextafterf(float from , float towards ); double nextafter(double from , double towards ); long double nextafterl(long double from , long double towards );
nextafter( ) , nextafterf( ) , and nextafterl( ) were defined by C99.
The nextafter( ) family of functions returns the next value after from that is closer to towards .
A related function is nexttoward ( ) .
#include <math.h>float nexttowardf(float from , long double towards ); double nexttoward(double from , long double towards ); long double nexttowardl(long double from , long double towards );
nexttoward( ) , nexttowardf( ) , and nexttowardl( ) were defined by C99.
The nexttoward( ) family of functions returns the next value after from that is closer to towards . They are the same as the nextafter( ) family, except that towards is a long double for all three functions.
A related function is nextafter( ) .
#include <math.h>float powf(float base , float exp );double pow(double base , double exp ); long double powl(long double base , long double exp );
powf( ) and powl( ) were added by C99.
The pow( ) family of functions returns base raised to the exp power (baseexp ) . A domain error may occur if base is zero and exp is less than or equal to zero. It will also happen if base is negative and exp is not an integer. A range error is possible.
Related functions are exp( ) , log( ) , and sqrt( ) .
#include <math.h>float remainderf(float a , float b );double remainder(double a , double b ); long double remainderl(long double a , long double b );
remainder( ) , remainderf( ) , and remainderl( ) were added by C99.
The remainder( ) family of functions returns the remainder of a/b .
A related function is remquo ( ) .
|
C(s)C++ Programmer's Reference Authors: Schildt H. Published year: 2002 Pages: 246-253/539 |