StrictMath.NextAfter Method

Definition

Overloads

NextAfter(Double, Double)

Returns the floating-point number adjacent to the first argument in the direction of the second argument.

NextAfter(Single, Double)

Returns the floating-point number adjacent to the first argument in the direction of the second argument.

NextAfter(Double, Double)

Returns the floating-point number adjacent to the first argument in the direction of the second argument.

[Android.Runtime.Register("nextAfter", "(DD)D", "")]
public static double NextAfter (double start, double direction);
[<Android.Runtime.Register("nextAfter", "(DD)D", "")>]
static member NextAfter : double * double -> double

Parameters

start
Double

starting floating-point value

direction
Double

value indicating which of start's neighbors or start should be returned

Returns

The floating-point number adjacent to start in the direction of direction.

Attributes

Remarks

Returns the floating-point number adjacent to the first argument in the direction of the second argument. If both arguments compare as equal the second argument is returned.

Special cases: <ul> <li> If either argument is a NaN, then NaN is returned.

<li> If both arguments are signed zeros, direction is returned unchanged (as implied by the requirement of returning the second argument if the arguments compare as equal).

<li> If start is &plusmn;Double#MIN_VALUE and direction has a value such that the result should have a smaller magnitude, then a zero with the same sign as start is returned.

<li> If start is infinite and direction has a value such that the result should have a smaller magnitude, Double#MAX_VALUE with the same sign as start is returned.

<li> If start is equal to &plusmn; Double#MAX_VALUE and direction has a value such that the result should have a larger magnitude, an infinity with same sign as start is returned. </ul>

Added in 1.6.

Java documentation for java.lang.StrictMath.nextAfter(double, double).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

NextAfter(Single, Double)

Returns the floating-point number adjacent to the first argument in the direction of the second argument.

[Android.Runtime.Register("nextAfter", "(FD)F", "")]
public static float NextAfter (float start, double direction);
[<Android.Runtime.Register("nextAfter", "(FD)F", "")>]
static member NextAfter : single * double -> single

Parameters

start
Single

starting floating-point value

direction
Double

value indicating which of start's neighbors or start should be returned

Returns

The floating-point number adjacent to start in the direction of direction.

Attributes

Remarks

Returns the floating-point number adjacent to the first argument in the direction of the second argument. If both arguments compare as equal a value equivalent to the second argument is returned.

Special cases: <ul> <li> If either argument is a NaN, then NaN is returned.

<li> If both arguments are signed zeros, a value equivalent to direction is returned.

<li> If start is &plusmn;Float#MIN_VALUE and direction has a value such that the result should have a smaller magnitude, then a zero with the same sign as start is returned.

<li> If start is infinite and direction has a value such that the result should have a smaller magnitude, Float#MAX_VALUE with the same sign as start is returned.

<li> If start is equal to &plusmn; Float#MAX_VALUE and direction has a value such that the result should have a larger magnitude, an infinity with same sign as start is returned. </ul>

Added in 1.6.

Java documentation for java.lang.StrictMath.nextAfter(float, double).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to