nextafter(), nextafterf(), nexttoward(), nexttowardf()

compute next representable floating-point value 

Function


SYNOPSIS

#include <math.h>

double nextafter(double x, double y)

float nextafterf(float x, float y)

double nexttoward(double x, long double y)

float nexttowardf(float x, long double y)


DESCRIPTION

The nextafter() class of functions compute the next machine representable number from x in the direction of y. Thus, if y is less than x, nextafter() returns the largest representable floating-point number less than x.

The nextafterf() and nexttowardf() function is a single-precision version of nextafter() and nexttoward().


PARAMETERS

x 

Is the base number for calculation.

y 

Is the number indicating relative direction for calculation.


RETURN VALUES

The nextafter() and nexttoward() functions return the next representable double-precision floating-point number following x in the direction of y.

If x or y is NaN, nextafter() returns NaN.

If x is finite and the correct function value would overflow, HUGE_VAL is returned and errno is set to ERANGE.


CONFORMANCE

ANSI/ISO 9899:1999 'ISO C99' with the extension that nextafter()(+0.0, -0.0) returns -0.0, and nextafter()(-0.0, +0.0) returns +0.0..


MULTITHREAD SAFETY LEVEL

MT-Safe.


PORTING ISSUES

None.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
math()


PTC MKS Toolkit 10.3 Documentation Build 39.