NEXTAFTER(3) BSD Programmer's Manual NEXTAFTER(3)

## NAME

**nextafter**, **nextafterf** - next representable floating-point number

## LIBRARY

libm

## SYNOPSIS

**#include <math.h>**
*double*
**nextafter**(*double x*, *double y*);
*float*
**nextafterf**(*float x*, *float y*);

## DESCRIPTION

The **nextafter**() and **nextafterf**() functions return the next machine
representable number from *x* in direction of *y*. In other words, if *y* is
less than *x*, the functions return the largest representable floating-
point number less than *x*. When *x* equals *y*, the value of *y* is returned.
The three functions differ only in the type of the return value and *x*.

## RETURN VALUES

Upon successful completion, the described functions return the next
representable floating-point value as described above. If *x* is 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 as *x*. When ei-
ther *x* or *y* is *NaN*, a *NaN* is returned. When *x* is not *y* but the function
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").
MirOS BSD #10-current February 9, 2014 1

Generated on 2014-04-02 20:57:59 by
`$MirOS: src/scripts/roff2htm,v 1.79 2014/02/10 00:36:11 tg Exp $`

These manual pages and other documentation are copyrighted by their respective writers;
their source is available at our CVSweb,
AnonCVS, and other mirrors. The rest is Copyright © 2002‒2014 The MirOS Project, Germany.

This product includes material
provided by Thorsten Glaser.

This manual page’s HTML representation
is supposed to be valid
XHTML/1.1; if not, please send a bug report – diffs preferred.