mathnexttoward Method (Double, Double) |
Gets the floating-point number that is next after fromNumber in the direction of towardNumber.
Namespace:
C
Assembly:
C.math (in C.math.dll) Version: 1.0.0.0 (1.0.0.0)
Syntaxpublic static double nexttoward(
double fromNumber,
double towardNumber
)
Public Shared Function nexttoward (
fromNumber As Double,
towardNumber As Double
) As Double
public:
static double nexttoward(
double fromNumber,
double towardNumber
)
static member nexttoward :
fromNumber : float *
towardNumber : float -> float
Parameters
- fromNumber
- Type: SystemDouble
A floating-point number. - towardNumber
- Type: SystemDouble
A floating-point number.
Return Value
Type:
DoubleThe floating-point number that is next after
fromNumber in the direction of
towardNumber.
Remarks
IEC 60559 recommends that fromNumber be returned whenever fromNumber == towardNumber.
These functions return towardNumber instead, which makes the behavior around zero consistent: nexttoward(-0.0, +0.0)
returns +0.0 and nexttoward(+0.0, -0.0) returns –0.0.
The nexttoward(Double, Double) function is equivalent to the nextafter(Double, Double) function.
See nexttoward in the C standard documentation.
See Also