Math.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

Java documentation for java.lang.Math.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

Java documentation for java.lang.Math.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