Chapter Contents

Previous

Next
nextafter

nextafter



Compute the next floating-number in a specific direction

Portability: C99


SYNOPSIS
DESCRIPTION
RETURN VALUE
RELATED FUNCTIONS
SEE ALSO


SYNOPSIS

   #include <math.h>

   double nextafter(double x, double y);
   float nextafterf(float x, float y);
   long double nextafterl(long double x, long double y);


DESCRIPTION

nextafter returns the next representable value after x in the direction of y. That is, if y > x, then the value returned is the next double greater than x; if y < x, the the value returned is the next double less than x; and if y == x, the value returned is y.

The function name nextafterf should be used for float arguments, and nextafterl for long double arguments. Alternately, if the header file tgmath.h is included, nextafter may be used with any numeric argument type.


RETURN VALUE

nextafter returns the next value after x (see DESCRIPTION).


RELATED FUNCTIONS

nexttoward


SEE ALSO

"Mathematical Functions" in Chapter 2, "Function Categories"


Chapter Contents

Previous

Next

Top of Page

Copyright © 2004 by SAS Institute Inc., Cary, NC, USA. All rights reserved.