Namespaces
Variants
Views
Actions

std::nextafter, std::nexttoward

From cppreference.com
< cpp‎ | numeric‎ | math
Revision as of 21:31, 2 November 2012 by P12bot (Talk | contribs)

 
 
 
 

Template:ddcl list begin <tr class="t-dsc-header">

<td>
Defined in header <cmath>
</td>

<td></td> <td></td> </tr> <tr class="t-dcl ">

<td >
float       nextafter( float from, float to );
</td>

<td > (1) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

<td >
double      nextafter( double from, double to );
</td>

<td > (2) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

<td >
long double nextafter( long double from, long double to );
</td>

<td > (3) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

<td >
Promoted    nextafter( Arithmetic from, Arithmetic to );
</td>

<td > (4) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

<td >
float       nexttoward( float from, long double to );
</td>

<td > (5) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

<td >
double      nexttoward( double from, long double to );
</td>

<td > (6) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

<td >
long double nexttoward( long double from, long double to );
</td>

<td > (7) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

<td >
double      nexttoward( Integral from, long double to );
</td>

<td > (8) </td> <td > (since C++11) </td> </tr> Template:ddcl list end

Returns the next representable value of from in the direction of to. If from equals to to, to is returned.

4) If any argument has integral type, it is cast to double. If any other argument is long double, then the return type is long double, otherwise it is double

Parameters

from, to - floating point values

Return value

the next representable value of from in the direction of to.

Example