Click or drag to resize
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)
Syntax
public static double nexttoward(
	double fromNumber,
	double towardNumber
)

Parameters

fromNumber
Type: SystemDouble
A floating-point number.
towardNumber
Type: SystemDouble
A floating-point number.

Return Value

Type: Double
The 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