math.nexttoward Method (Single, Single) |
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 float nexttoward(
float fromNumber,
float towardNumber
)
Public Shared Function nexttoward (
fromNumber As Single,
towardNumber As Single
) As Single
public:
static float nexttoward(
float fromNumber,
float towardNumber
)
static member nexttoward :
fromNumber : float32 *
towardNumber : float32 -> float32
Parameters
- fromNumber
- Type: System.Single
A floating-point number. - towardNumber
- Type: System.Single
A floating-point number.
Return Value
Type:
SingleThe 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(Single, Single) function is equivalent to the nextafter(Single, Single) function.
See nexttoward in the C standard documentation.
See Also