Android Guides | Samples

Java.Lang.StrictMath Class

Class StrictMath provides basic math constants and operations such as trigonometric functions, hyperbolic functions, exponential, logarithms, etc.

See Also: StrictMath

Syntax

[Android.Runtime.Register("java/lang/StrictMath", DoNotGenerateAcw=true)]
public sealed class StrictMath : Object

Remarks

Class StrictMath provides basic math constants and operations such as trigonometric functions, hyperbolic functions, exponential, logarithms, etc.

In contrast to class Math, the methods in this class return exactly the same results on all platforms. Algorithms based on these methods thus behave the same (e.g. regarding numerical convergence) on all platforms, complying with the slogan "write once, run everywhere". On the other side, the implementation of class StrictMath may be less efficient than that of class Math, as class StrictMath cannot utilize platform specific features such as an extended precision math co-processors.

The methods in this class are specified using the "Freely Distributable Math Library" (fdlibm), version 5.3.

[Android Documentation]

Requirements

Namespace: Java.Lang
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1

The members of Java.Lang.StrictMath are listed below.

See Also: Object

Public Fields

const
EDouble (2.71828182845905). The double value closest to e, the base of the natural logarithm.
const
PiDouble (3.14159265358979). The double value closest to pi, the ratio of a circle's circumference to its diameter.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

static
Abs(Double) : Double
Returns the absolute value of the argument.
static
Abs(Int32) : Int32
Returns the absolute value of the argument.
static
Abs(Int64) : Int64
Returns the absolute value of the argument.
static
Abs(Single) : Single
Returns the absolute value of the argument.
static
Acos(Double) : Double
Returns the closest double approximation of the arc cosine of the argument within the range [0..pi].
static
Asin(Double) : Double
Returns the closest double approximation of the arc sine of the argument within the range [-pi/2..pi/2].
static
Atan(Double) : Double
Returns the closest double approximation of the arc tangent of the argument within the range [-pi/2..pi/2].
static
Atan2(Double, Double) : Double
Returns the closest double approximation of the arc tangent of y/x within the range [-pi..pi].
static
Cbrt(Double) : Double
Returns the closest double approximation of the cube root of the argument.
static
Ceil(Double) : Double
Returns the double conversion of the most negative (closest to negative infinity) integer value greater than or equal to the argument.
static
CopySign(Double, Double) : Double
Returns a double with the given magnitude and the sign of sign.
static
CopySign(Single, Single) : Single
Returns a float with the given magnitude and the sign of sign.
static
Cos(Double) : Double
Returns the closest double approximation of the cosine of the argument.
static
Cosh(Double) : Double
Returns the closest double approximation of the hyperbolic cosine of the argument.
static
Exp(Double) : Double
Returns the closest double approximation of the raising "e" to the power of the argument.
static
Expm1(Double) : Double
Returns the closest double approximation of ed- 1.
static
Floor(Double) : Double
Returns the double conversion of the most positive (closest to positive infinity) integer less than or equal to the argument.
static
GetExponent(Double) : Int32
Returns the exponent of double d.
static
GetExponent(Single) : Int32
Returns the exponent of float f.
static
Hypot(Double, Double) : Double
Returns sqrt(x2+y2).
static
IEEEremainder(Double, Double) : Double
Returns the remainder of dividing x by y using the IEEE 754 rules.
static
Log(Double) : Double
Returns the closest double approximation of the natural logarithm of the argument.
static
Log10(Double) : Double
Returns the closest double approximation of the base 10 logarithm of the argument.
static
Log1p(Double) : Double
Returns the closest double approximation of the natural logarithm of the sum of the argument and 1.
static
Max(Double, Double) : Double
Returns the most positive (closest to positive infinity) of the two arguments.
static
Max(Int32, Int32) : Int32
Returns the most positive (closest to positive infinity) of the two arguments.
static
Max(Int64, Int64) : Int64
Returns the most positive (closest to positive infinity) of the two arguments.
static
Max(Single, Single) : Single
Returns the most positive (closest to positive infinity) of the two arguments.
static
Min(Double, Double) : Double
Returns the most negative (closest to negative infinity) of the two arguments.
static
Min(Int32, Int32) : Int32
Returns the most negative (closest to negative infinity) of the two arguments.
static
Min(Int64, Int64) : Int64
Returns the most negative (closest to negative infinity) of the two arguments.
static
Min(Single, Single) : Single
Returns the most negative (closest to negative infinity) of the two arguments.
static
NextAfter(Double, Double) : Double
Returns the next double after start in the given direction.
static
NextAfter(Single, Double) : Single
Returns the next float after start in the given direction .
static
NextUp(Double) : Double
Returns the next double larger than d.
static
NextUp(Single) : Single
Returns the next float larger than f.
static
Pow(Double, Double) : Double
Returns the closest double approximation of the result of raising x to the power of y.
static
Random() : Double
Returns a pseudo-random number between 0.0 (inclusive) and 1.0 (exclusive).
static
Rint(Double) : Double
Returns the double conversion of the result of rounding the argument to an integer.
static
Round(Double) : Int64
Returns the result of rounding the argument to an integer.
static
Round(Single) : Int32
Returns the result of rounding the argument to an integer.
static
Scalb(Double, Int32) : Double
Returns d * 2^scaleFactor.
static
Scalb(Single, Int32) : Single
Returns d * 2^scaleFactor.
static
Signum(Double) : Double
Returns the signum function of the argument.
static
Signum(Single) : Single
Returns the signum function of the argument.
static
Sin(Double) : Double
Returns the closest double approximation of the sine of the argument.
static
Sinh(Double) : Double
Returns the closest double approximation of the hyperbolic sine of the argument.
static
Sqrt(Double) : Double
Returns the closest double approximation of the square root of the argument.
static
Tan(Double) : Double
Returns the closest double approximation of the tangent of the argument.
static
Tanh(Double) : Double
Returns the closest double approximation of the hyperbolic tangent of the argument.
static
ToDegrees(Double) : Double
Returns the measure in degrees of the supplied radian angle.
static
ToRadians(Double) : Double
Returns the measure in radians of the supplied degree angle.
static
Ulp(Double) : Double
Returns the argument's ulp (unit in the last place).
static
Ulp(Single) : Single
Returns the argument's ulp (unit in the last place).