NEXTAFTER(3) NetBSD Library Functions Manual NEXTAFTER(3)NAME

nextafter,nextafterf,nextafterl,nexttoward,nexttowardf,nexttowardl-- next representable floating-point numberLIBRARY

Math Library (libm, -lm)SYNOPSIS

#include <math.h>doublenextafter(double x,double y);floatnextafterf(float x,float y);long doublenextafterl(long double x,long double y);doublenexttoward(double x,long double y);floatnexttowardf(float x,long double y);long doublenexttowardl(long double x,long double y);DESCRIPTION

Thenextafter(),nextafterf(), andnextafterl() functions return the next machine representable number fromxin direction ofy. In other words, ifyis less thanx, the functions return the largest representable floating-point number less thanx. Whenxequalsy, the value ofyis returned. The three functions differ only in the type of the return value andx. Thenexttoward() andnexttowardf() functions are equivalent to thenextafter() family of functions with two exceptions: 1. The second parameter has a typelong double. 2. The return value isyconverted to the type of the function, provided thatxequalsy.nexttowardl() is equivalent tonextafterl().RETURN VALUES

Upon successful completion, the described functions return the next rep- resentable floating-point value as described above. Ifxis finite but an overflow would occur, a range error follows and the functions return ħHUGE_VAL, ħHUGE_VALF, or ħHUGE_VALL with the same sign asx. When eitherxoryisNaN, aNaNis returned. Whenxis notybut the func- tion value is subnormal, zero, or underflows, a range error occurs, and either 0.0 or the correct function value (if representable) is returned.SEE ALSO

math(3)STANDARDS

The described functions conform to ISO/IEC 9899:1999 (``ISO C99''). NetBSD 10.0 September 13, 2015 NetBSD 10.0

Powered by man-cgi (2024-08-26). Maintained for NetBSD by Kimmo Suominen. Based on man-cgi by Panagiotis Christias.