[−][src]Struct js_sys::Math
Methods
impl Math
[src]
pub fn abs(x: f64) -> f64
[src]
The Math.abs() function returns the absolute value of a number, that is Math.abs(x) = |x|
impl Math
[src]
pub fn acos(x: f64) -> f64
[src]
The Math.acos() function returns the arccosine (in radians) of a number, that is ∀x∊[-1;1] Math.acos(x) = arccos(x) = the unique y∊[0;π] such that cos(y)=x
impl Math
[src]
pub fn acosh(x: f64) -> f64
[src]
The Math.acosh() function returns the hyperbolic arc-cosine of a number, that is ∀x ≥ 1 Math.acosh(x) = arcosh(x) = the unique y ≥ 0 such that cosh(y) = x
impl Math
[src]
pub fn asin(x: f64) -> f64
[src]
The Math.asin() function returns the arcsine (in radians) of a number, that is ∀x ∊ [-1;1] Math.asin(x) = arcsin(x) = the unique y∊[-π2;π2] such that sin(y) = x
impl Math
[src]
pub fn asinh(x: f64) -> f64
[src]
The Math.asinh() function returns the hyperbolic arcsine of a number, that is Math.asinh(x) = arsinh(x) = the unique y such that sinh(y) = x
impl Math
[src]
pub fn atan(x: f64) -> f64
[src]
The Math.atan() function returns the arctangent (in radians) of a number, that is Math.atan(x) = arctan(x) = the unique y ∊ [-π2;π2]such that tan(y) = x
impl Math
[src]
pub fn atan2(y: f64, x: f64) -> f64
[src]
The Math.atan2() function returns the arctangent of the quotient of its arguments.
impl Math
[src]
pub fn atanh(x: f64) -> f64
[src]
The Math.atanh() function returns the hyperbolic arctangent of a number, that is ∀x ∊ (-1,1), Math.atanh(x) = arctanh(x) = the unique y such that tanh(y) = x
impl Math
[src]
pub fn cbrt(x: f64) -> f64
[src]
The Math.cbrt() function returns the cube root of a number, that is Math.cbrt(x) = x^3 = the unique y such that y^3 = x
impl Math
[src]
pub fn ceil(x: f64) -> f64
[src]
The Math.ceil() function returns the smallest integer greater than or equal to a given number.
impl Math
[src]
pub fn clz32(x: i32) -> u32
[src]
The Math.clz32() function returns the number of leading zero bits in the 32-bit binary representation of a number.
impl Math
[src]
pub fn cos(x: f64) -> f64
[src]
The Math.cos() static function returns the cosine of the specified angle, which must be specified in radians. This value is length(adjacent)/length(hypotenuse).
impl Math
[src]
pub fn cosh(x: f64) -> f64
[src]
The Math.cosh() function returns the hyperbolic cosine of a number, that can be expressed using the constant e.
impl Math
[src]
pub fn exp(x: f64) -> f64
[src]
The Math.exp() function returns e^x, where x is the argument, and e is Euler's number (also known as Napier's constant), the base of the natural logarithms.
impl Math
[src]
pub fn expm1(x: f64) -> f64
[src]
The Math.expm1() function returns e^x - 1, where x is the argument, and e the base of the natural logarithms.
impl Math
[src]
pub fn floor(x: f64) -> f64
[src]
The Math.floor() function returns the largest integer less than or equal to a given number.
impl Math
[src]
pub fn fround(x: f64) -> f32
[src]
The Math.fround() function returns the nearest 32-bit single precision float representation of a Number.
impl Math
[src]
pub fn hypot(x: f64, y: f64) -> f64
[src]
The Math.hypot() function returns the square root of the sum of squares of its arguments.
impl Math
[src]
pub fn imul(x: i32, y: i32) -> i32
[src]
The Math.imul() function returns the result of the C-like 32-bit multiplication of the two parameters.
impl Math
[src]
pub fn log(x: f64) -> f64
[src]
The Math.log() function returns the natural logarithm (base e) of a number. The JavaScript Math.log() function is equivalent to ln(x) in mathematics.
impl Math
[src]
pub fn log10(x: f64) -> f64
[src]
The Math.log10() function returns the base 10 logarithm of a number.
impl Math
[src]
pub fn log1p(x: f64) -> f64
[src]
The Math.log1p() function returns the natural logarithm (base e) of 1 + a number. MDN documentation
impl Math
[src]
impl Math
[src]
impl Math
[src]
pub fn min(x: f64, y: f64) -> f64
[src]
The static function Math.min() returns the lowest-valued number passed into it.
impl Math
[src]
pub fn pow(base: f64, exponent: f64) -> f64
[src]
The Math.pow() function returns the base to the exponent power, that is, base^exponent.
impl Math
[src]
pub fn random() -> f64
[src]
The Math.random() function returns a floating-point, pseudo-random number in the range 0–1 (inclusive of 0, but not 1) with approximately uniform distribution over that range — which you can then scale to your desired range. The implementation selects the initial seed to the random number generation algorithm; it cannot be chosen or reset by the user.
impl Math
[src]
pub fn round(x: f64) -> f64
[src]
The Math.round() function returns the value of a number rounded to the nearest integer.
impl Math
[src]
pub fn sign(x: f64) -> f64
[src]
The Math.sign() function returns the sign of a number, indicating whether the number is positive, negative or zero.
impl Math
[src]
impl Math
[src]
pub fn sinh(x: f64) -> f64
[src]
The Math.sinh() function returns the hyperbolic sine of a number, that can be expressed using the constant e: Math.sinh(x) = (e^x - e^-x)/2
impl Math
[src]
pub fn sqrt(x: f64) -> f64
[src]
The Math.sqrt() function returns the square root of a number, that is ∀x ≥ 0, Math.sqrt(x) = √x = the unique y ≥ 0 such that y^2 = x
impl Math
[src]
impl Math
[src]
pub fn tanh(x: f64) -> f64
[src]
The Math.tanh() function returns the hyperbolic tangent of a number, that is tanh x = sinh x / cosh x = (e^x - e^-x)/(e^x + e^-x) = (e^2x - 1)/(e^2x + 1)
impl Math
[src]
pub fn trunc(x: f64) -> f64
[src]
The Math.trunc() function returns the integer part of a number by removing any fractional digits.
Methods from Deref<Target = Object>
pub fn constructor(&self) -> Function
[src]
The constructor property returns a reference to the Object constructor function that created the instance object.
pub fn has_own_property(&self, property: &JsValue) -> bool
[src]
The hasOwnProperty()
method returns a boolean indicating whether the
object has the specified property as its own property (as opposed to
inheriting it).
pub fn is_prototype_of(&self, value: &JsValue) -> bool
[src]
The isPrototypeOf()
method checks if an object exists in another
object's prototype chain.
pub fn property_is_enumerable(&self, property: &JsValue) -> bool
[src]
The propertyIsEnumerable()
method returns a Boolean indicating
whether the specified property is enumerable.
pub fn to_locale_string(&self) -> JsString
[src]
The toLocaleString()
method returns a string representing the object.
This method is meant to be overridden by derived objects for
locale-specific purposes.
pub fn to_string(&self) -> JsString
[src]
The toString()
method returns a string representing the object.
pub fn value_of(&self) -> Object
[src]
The valueOf()
method returns the primitive value of the
specified object.
Trait Implementations
impl Clone for Math
[src]
fn clone(&self) -> Math
[src]
default fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl AsRef<JsValue> for Math
[src]
impl AsRef<Object> for Math
[src]
impl From<JsValue> for Math
[src]
impl From<Math> for JsValue
[src]
impl From<Math> for Object
[src]
impl Deref for Math
[src]
impl Debug for Math
[src]
impl RefFromWasmAbi for Math
[src]
type Abi = <JsValue as RefFromWasmAbi>::Abi
The wasm ABI type references to Self
are recovered from.
type Anchor = ManuallyDrop<Math>
The type that holds the reference to Self
for the duration of the invocation of the function that has an &Self
parameter. This is required to ensure that the lifetimes don't persist beyond one function call, and so that they remain anonymous. Read more
unsafe fn ref_from_abi(js: Self::Abi, extra: &mut dyn Stack) -> Self::Anchor
[src]
impl IntoWasmAbi for Math
[src]
type Abi = <JsValue as IntoWasmAbi>::Abi
The wasm ABI type that this converts into when crossing the ABI boundary. Read more
fn into_abi(self, extra: &mut dyn Stack) -> Self::Abi
[src]
impl<'a> IntoWasmAbi for &'a Math
[src]
type Abi = <&'a JsValue as IntoWasmAbi>::Abi
The wasm ABI type that this converts into when crossing the ABI boundary. Read more
fn into_abi(self, extra: &mut dyn Stack) -> Self::Abi
[src]
impl WasmDescribe for Math
[src]
impl FromWasmAbi for Math
[src]
type Abi = <JsValue as FromWasmAbi>::Abi
The wasm ABI type that this converts from when coming back out from the ABI boundary. Read more
unsafe fn from_abi(js: Self::Abi, extra: &mut dyn Stack) -> Self
[src]
impl OptionIntoWasmAbi for Math
[src]
impl<'a> OptionIntoWasmAbi for &'a Math
[src]
impl OptionFromWasmAbi for Math
[src]
impl JsCast for Math
[src]
fn instanceof(val: &JsValue) -> bool
[src]
fn unchecked_from_js(val: JsValue) -> Self
[src]
fn unchecked_from_js_ref(val: &JsValue) -> &Self
[src]
default fn is_instance_of<T>(&self) -> bool where
T: JsCast,
[src]
T: JsCast,
Test whether this JS value is an instance of the type T
. Read more
default fn dyn_into<T>(self) -> Result<T, Self> where
T: JsCast,
[src]
T: JsCast,
Performs a dynamic cast (checked at runtime) of this value into the target type T
. Read more
default fn dyn_ref<T>(&self) -> Option<&T> where
T: JsCast,
[src]
T: JsCast,
Performs a dynamic cast (checked at runtime) of this value into the target type T
. Read more
default fn unchecked_into<T>(self) -> T where
T: JsCast,
[src]
T: JsCast,
Performs a zero-cost unchecked cast into the specified type. Read more
default fn unchecked_ref<T>(&self) -> &T where
T: JsCast,
[src]
T: JsCast,
Performs a zero-cost unchecked cast into a reference to the specified type. Read more
Auto Trait Implementations
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> ReturnWasmAbi for T where
T: IntoWasmAbi,
[src]
T: IntoWasmAbi,
type Abi = <T as IntoWasmAbi>::Abi
Same as IntoWasmAbi::Abi