다음을 통해 공유


StrictMath.Ulp Method

Definition

Overloads

Ulp(Double)

Returns the size of an ulp of the argument.

Ulp(Single)

Returns the size of an ulp of the argument.

Ulp(Double)

Returns the size of an ulp of the argument.

[Android.Runtime.Register("ulp", "(D)D", "")]
public static double Ulp (double d);
[<Android.Runtime.Register("ulp", "(D)D", "")>]
static member Ulp : double -> double

Parameters

d
Double

the floating-point value whose ulp is to be returned

Returns

the size of an ulp of the argument

Attributes

Remarks

Returns the size of an ulp of the argument. An ulp, unit in the last place, of a double value is the positive distance between this floating-point value and the double value next larger in magnitude. Note that for non-NaN x, ulp(-<i>x</i>) == ulp(<i>x</i>).

Special Cases: <ul> <li> If the argument is NaN, then the result is NaN. <li> If the argument is positive or negative infinity, then the result is positive infinity. <li> If the argument is positive or negative zero, then the result is Double.MIN_VALUE. <li> If the argument is &plusmn;Double.MAX_VALUE, then the result is equal to 2<sup>971</sup>. </ul>

Added in 1.5.

Java documentation for java.lang.StrictMath.ulp(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

Ulp(Single)

Returns the size of an ulp of the argument.

[Android.Runtime.Register("ulp", "(F)F", "")]
public static float Ulp (float f);
[<Android.Runtime.Register("ulp", "(F)F", "")>]
static member Ulp : single -> single

Parameters

f
Single

the floating-point value whose ulp is to be returned

Returns

the size of an ulp of the argument

Attributes

Remarks

Returns the size of an ulp of the argument. An ulp, unit in the last place, of a float value is the positive distance between this floating-point value and the float value next larger in magnitude. Note that for non-NaN x, ulp(-<i>x</i>) == ulp(<i>x</i>).

Special Cases: <ul> <li> If the argument is NaN, then the result is NaN. <li> If the argument is positive or negative infinity, then the result is positive infinity. <li> If the argument is positive or negative zero, then the result is Float.MIN_VALUE. <li> If the argument is &plusmn;Float.MAX_VALUE, then the result is equal to 2<sup>104</sup>. </ul>

Added in 1.5.

Java documentation for java.lang.StrictMath.ulp(float).

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