Sdílet prostřednictvím


StrictMath.Round Method

Definition

Overloads

Round(Double)

Returns the closest long to the argument, with ties rounding to positive infinity.

Round(Single)

Returns the closest int to the argument, with ties rounding to positive infinity.

Round(Double)

Returns the closest long to the argument, with ties rounding to positive infinity.

[Android.Runtime.Register("round", "(D)J", "")]
public static long Round (double a);
[<Android.Runtime.Register("round", "(D)J", "")>]
static member Round : double -> int64

Parameters

a
Double

a floating-point value to be rounded to a long.

Returns

the value of the argument rounded to the nearest long value.

Attributes

Remarks

Returns the closest long to the argument, with ties rounding to positive infinity.

Special cases: <ul><li>If the argument is NaN, the result is 0. <li>If the argument is negative infinity or any value less than or equal to the value of Long.MIN_VALUE, the result is equal to the value of Long.MIN_VALUE. <li>If the argument is positive infinity or any value greater than or equal to the value of Long.MAX_VALUE, the result is equal to the value of Long.MAX_VALUE.</ul>

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

Round(Single)

Returns the closest int to the argument, with ties rounding to positive infinity.

[Android.Runtime.Register("round", "(F)I", "")]
public static int Round (float a);
[<Android.Runtime.Register("round", "(F)I", "")>]
static member Round : single -> int

Parameters

a
Single

a floating-point value to be rounded to an integer.

Returns

the value of the argument rounded to the nearest int value.

Attributes

Remarks

Returns the closest int to the argument, with ties rounding to positive infinity.

Special cases: <ul><li>If the argument is NaN, the result is 0. <li>If the argument is negative infinity or any value less than or equal to the value of Integer.MIN_VALUE, the result is equal to the value of Integer.MIN_VALUE. <li>If the argument is positive infinity or any value greater than or equal to the value of Integer.MAX_VALUE, the result is equal to the value of Integer.MAX_VALUE.</ul>

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