imaxabs


imaxabs

Gives the absolute value of a number of the longest available integer type

 #include <inttypes.h> intmax_t imaxabs ( intmax_t n  ) 

The imaxabs( ) function is the same as either labs( ) or llabs( ), depending on how many bits wide the system's largest integer type is. Accordingly, the type intmax_t is the same as either long or long long.

Example

 intmax_t quantity1 = 9182734; intmax_t quantity2 = 1438756; printf( "The difference between the two quantities is %ji.\n",         imaxabs( quantity2 - quantity1 ));

See Also

abs( ), labs( ), llabs( ), fabs( )



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