Math Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
The class Math contains methods for performing basic
numeric operations such as the elementary exponential, logarithm,
square root, and trigonometric functions.
[Android.Runtime.Register("java/lang/Math", DoNotGenerateAcw=true)]
public sealed class Math : Java.Lang.Object
[<Android.Runtime.Register("java/lang/Math", DoNotGenerateAcw=true)>]
type Math = class
inherit Object
- Inheritance
- Attributes
Remarks
Java documentation for java.lang.Math.
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.
Fields
| Name | Description |
|---|---|
| E |
The |
| Pi |
The |
| Tau |
The circle constant equal to twice pi. |
Properties
| Name | Description |
|---|---|
| Class |
Returns the runtime class of this |
| Handle |
The handle to the underlying Android instance. (Inherited from Object) |
| JniIdentityHashCode |
Gets the identity hash code assigned to this Java peer by the interop runtime. (Inherited from Object) |
| JniManagedPeerState | (Inherited from JavaObject) |
| JniPeerMembers |
Gets the JNI metadata used to invoke members of this Java peer. |
| PeerReference |
Gets the JNI object reference for this Java peer. (Inherited from Object) |
| ThresholdClass |
This API supports the Mono for Android infrastructure and is not intended to be used directly from your code. (Inherited from Object) |
| ThresholdType |
This API supports the Mono for Android infrastructure and is not intended to be used directly from your code. (Inherited from Object) |
Methods
| Name | Description |
|---|---|
| Abs(Double) |
Returns the absolute value of a |
| Abs(Int32) |
Returns the absolute value of an |
| Abs(Int64) |
Returns the absolute value of a |
| Abs(Single) |
Returns the absolute value of a |
| AbsExact(Int32) |
Returns the absolute value of |
| AbsExact(Int64) |
Returns the absolute value of |
| Acos(Double) |
Returns the arc cosine of a value; the returned angle is in the range 0. |
| AddExact(Int32, Int32) |
Returns the sum of its arguments,
throwing an exception if the result overflows an |
| AddExact(Int64, Int64) |
Returns the sum of its arguments,
throwing an exception if the result overflows a |
| Asin(Double) |
Returns the arc sine of a value; the returned angle is in the range -pi/2 through pi/2. |
| Atan(Double) |
Returns the arc tangent of a value; the returned angle is in the range -pi/2 through pi/2. |
| Atan2(Double, Double) |
Returns the angle theta from the conversion of rectangular
coordinates ( |
| Cbrt(Double) |
Returns the cube root of a |
| Ceil(Double) |
Returns the smallest (closest to negative infinity)
|
| CeilDiv(Int32, Int32) |
Returns |
| CeilDiv(Int64, Int32) |
Returns |
| CeilDiv(Int64, Int64) |
Returns |
| CeilDivExact(Int32, Int32) |
Returns |
| CeilDivExact(Int64, Int64) |
Returns |
| CeilMod(Int32, Int32) |
Returns the remainder associated with ceiling division. |
| CeilMod(Int64, Int32) |
Returns the remainder associated with ceiling division. |
| CeilMod(Int64, Int64) |
Returns the remainder associated with ceiling division. |
| Clamp(Double, Double, Double) |
Constrains a value to the specified inclusive range, returning |
| Clamp(Int64, Int32, Int32) |
Constrains a value to the specified inclusive range. |
| Clamp(Int64, Int64, Int64) |
Constrains a value to the specified inclusive range. |
| Clamp(Single, Single, Single) |
Constrains a value to the specified inclusive range, returning |
| Clone() |
Creates and returns a copy of this object. (Inherited from Object) |
| Construct(JniObjectReference, JniObjectReferenceOptions) | (Inherited from JavaObject) |
| CopySign(Double, Double) |
Returns the first floating-point argument with the sign of the second floating-point argument. |
| CopySign(Single, Single) |
Returns the first floating-point argument with the sign of the second floating-point argument. |
| Cos(Double) |
Returns the trigonometric cosine of an angle. |
| Cosh(Double) |
Returns the hyperbolic cosine of a |
| DecrementExact(Int32) |
Returns the argument decremented by one, throwing an exception if the
result overflows an |
| DecrementExact(Int64) |
Returns the argument decremented by one, throwing an exception if the
result overflows a |
| Dispose() |
Releases the resources held by this Java peer. (Inherited from Object) |
| Dispose(Boolean) |
Releases the resources held by this Java peer. (Inherited from Object) |
| DisposeUnlessReferenced() | (Inherited from JavaObject) |
| DivideExact(Int32, Int32) |
Returns the quotient of |
| DivideExact(Int64, Int64) |
Returns the quotient of |
| Equals(Object) | (Inherited from JavaObject) |
| Equals(Object) |
Indicates whether some other object is "equal to" this one. (Inherited from Object) |
| Exp(Double) |
Returns Euler's number e raised to the power of a
|
| Expm1(Double) |
Returns e<sup>x</sup> -1. |
| Floor(Double) |
Returns the largest (closest to positive infinity)
|
| FloorDiv(Int32, Int32) |
Returns the largest (closest to positive infinity)
|
| FloorDiv(Int64, Int32) |
Returns the largest (closest to positive infinity)
|
| FloorDiv(Int64, Int64) |
Returns the largest (closest to positive infinity)
|
| FloorDivExact(Int32, Int32) |
Returns |
| FloorDivExact(Int64, Int64) |
Returns |
| FloorMod(Int32, Int32) |
Returns the floor modulus of the |
| FloorMod(Int64, Int32) |
Returns the floor modulus of the |
| FloorMod(Int64, Int64) |
Returns the floor modulus of the |
| Fma(Double, Double, Double) |
Returns the fused multiply add of the three arguments; that is,
returns the exact product of the first two arguments summed
with the third argument and then rounded once to the nearest
|
| Fma(Single, Single, Single) |
Returns the fused multiply add of the three arguments; that is,
returns the exact product of the first two arguments summed
with the third argument and then rounded once to the nearest
|
| GetExponent(Double) |
Returns the unbiased exponent used in the representation of a
|
| GetExponent(Single) |
Returns the unbiased exponent used in the representation of a
|
| GetHashCode() |
Returns a hash code value for the object. (Inherited from Object) |
| Hypot(Double, Double) |
Returns sqrt(x<sup>2</sup> +y<sup>2</sup>) without intermediate overflow or underflow. |
| IEEEremainder(Double, Double) |
Computes the remainder operation on two arguments as prescribed by the IEEE 754 standard. |
| IncrementExact(Int32) |
Returns the argument incremented by one, throwing an exception if the
result overflows an |
| IncrementExact(Int64) |
Returns the argument incremented by one, throwing an exception if the
result overflows a |
| JavaFinalize() |
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. (Inherited from Object) |
| Log(Double) |
Returns the natural logarithm (base e) of a |
| Log10(Double) |
Returns the base 10 logarithm of a |
| Log1p(Double) |
Returns the natural logarithm of the sum of the argument and 1. |
| Max(Double, Double) |
Returns the greater of two |
| Max(Int32, Int32) |
Returns the greater of two |
| Max(Int64, Int64) |
Returns the greater of two |
| Max(Single, Single) |
Returns the greater of two |
| Min(Double, Double) |
Returns the smaller of two |
| Min(Int32, Int32) |
Returns the smaller of two |
| Min(Int64, Int64) |
Returns the smaller of two |
| Min(Single, Single) |
Returns the smaller of two |
| MultiplyExact(Int32, Int32) |
Returns the product of the arguments,
throwing an exception if the result overflows an |
| MultiplyExact(Int64, Int32) |
Returns the product of the arguments, throwing an exception if the result
overflows a |
| MultiplyExact(Int64, Int64) |
Returns the product of the arguments,
throwing an exception if the result overflows a |
| MultiplyFull(Int32, Int32) |
Returns the exact mathematical product of the arguments. |
| MultiplyHigh(Int64, Int64) |
Returns as a |
| NegateExact(Int32) |
Returns the negation of the argument, throwing an exception if the
result overflows an |
| NegateExact(Int64) |
Returns the negation of the argument, throwing an exception if the
result overflows a |
| 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. |
| NextDown(Double) |
Returns the floating-point value adjacent to |
| NextDown(Single) |
Returns the floating-point value adjacent to |
| NextUp(Double) |
Returns the floating-point value adjacent to |
| NextUp(Single) |
Returns the floating-point value adjacent to |
| Notify() |
Wakes up a single thread that is waiting on this object's monitor. (Inherited from Object) |
| NotifyAll() |
Wakes up all threads that are waiting on this object's monitor. (Inherited from Object) |
| Pow(Double, Double) |
Returns the value of the first argument raised to the power of the second argument. |
| Random() |
Returns a |
| Rint(Double) |
Returns the |
| Round(Double) |
Returns the closest |
| Round(Single) |
Returns the closest |
| Scalb(Double, Int32) |
Returns |
| Scalb(Single, Int32) |
Returns |
| SetHandle(IntPtr, JniHandleOwnership) |
Sets the Handle property. (Inherited from Object) |
| SetPeerReference(JniObjectReference, JniObjectReferenceOptions) | (Inherited from JavaObject) |
| Signum(Double) |
Returns the signum function of the argument; zero if the argument is zero, 1. |
| Signum(Single) |
Returns the signum function of the argument; zero if the argument is zero, 1. |
| Sin(Double) |
Returns the trigonometric sine of an angle. |
| Sinh(Double) |
Returns the hyperbolic sine of a |
| Sqrt(Double) |
Returns the correctly rounded positive square root of a
|
| SubtractExact(Int32, Int32) |
Returns the difference of the arguments,
throwing an exception if the result overflows an |
| SubtractExact(Int64, Int64) |
Returns the difference of the arguments,
throwing an exception if the result overflows a |
| Tan(Double) |
Returns the trigonometric tangent of an angle. |
| Tanh(Double) |
Returns the hyperbolic tangent of a |
| ToArray<T>() |
Creates a managed array from this Java array wrapper. (Inherited from Object) |
| ToDegrees(Double) |
Converts an angle measured in radians to an approximately equivalent angle measured in degrees. |
| ToIntExact(Int64) |
Returns the value of the |
| ToRadians(Double) |
Converts an angle measured in degrees to an approximately equivalent angle measured in radians. |
| ToString() |
Returns a string representation of the object. (Inherited from Object) |
| Ulp(Double) |
Returns the size of an ulp of the argument. |
| Ulp(Single) |
Returns the size of an ulp of the argument. |
| UnregisterFromRuntime() |
Unregisters this Java peer from the interop runtime. (Inherited from Object) |
| UnsignedMultiplyHigh(Int64, Int64) |
Returns the most significant 64 bits of the unsigned 128-bit product. |
| Wait() |
Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>. (Inherited from Object) |
| Wait(Int64, Int32) |
Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed. (Inherited from Object) |
| Wait(Int64) |
Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed. (Inherited from Object) |
Explicit Interface Implementations
| Name | Description |
|---|---|
| IJavaPeerable.Disposed() | (Inherited from JavaObject) |
| IJavaPeerable.Finalized() | (Inherited from JavaObject) |
| IJavaPeerable.JniObjectReferenceControlBlock | (Inherited from JavaObject) |
| IJavaPeerable.SetJniIdentityHashCode(Int32) | (Inherited from JavaObject) |
| IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) | (Inherited from JavaObject) |
| IJavaPeerable.SetPeerReference(JniObjectReference) | (Inherited from JavaObject) |
Extension Methods
| Name | Description |
|---|---|
| GetJniTypeName(IJavaPeerable) |
Gets the JNI name of the type of the instance |
| JavaAs<TResult>(IJavaPeerable) |
Try to coerce |
| JavaCast<TResult>(IJavaObject) |
Performs an Android runtime-checked type conversion. |
| JavaCast<TResult>(IJavaObject) | |
| TryJavaCast<TResult>(IJavaPeerable, TResult) |
Try to coerce |