71 lines
13 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Math` mod in crate `js_sys`."><meta name="keywords" content="rust, rustlang, rust-lang, Math"><title>js_sys::Math - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../../js_sys/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Module Math</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#functions">Functions</a></li></ul></div><p class='location'><a href='../index.html'>js_sys</a></p><script>window.sidebarCurrent = {name: 'Math', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>&#x2212;</span>]</a></span><a class='srclink' href='../../src/js_sys/lib.rs.html#1558-1804' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../index.html'>js_sys</a>::<wbr><a class="mod" href=''>Math</a></span></h1><h2 id='functions' class='section-header'><a href="#functions">Functions</a></h2>
<table><tr class='module-item'><td><a class="fn" href="fn.abs.html" title='js_sys::Math::abs fn'>abs</a></td><td class='docblock-short'><p>The <code>Math.abs()</code> function returns the absolute value of a number, that is
Math.abs(x) = |x|</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.acos.html" title='js_sys::Math::acos fn'>acos</a></td><td class='docblock-short'><p>The <code>Math.acos()</code> 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</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.acosh.html" title='js_sys::Math::acosh fn'>acosh</a></td><td class='docblock-short'><p>The <code>Math.acosh()</code> 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</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.asin.html" title='js_sys::Math::asin fn'>asin</a></td><td class='docblock-short'><p>The <code>Math.asin()</code> 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</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.asinh.html" title='js_sys::Math::asinh fn'>asinh</a></td><td class='docblock-short'><p>The <code>Math.asinh()</code> function returns the hyperbolic arcsine of a
number, that is Math.asinh(x) = arsinh(x) = the unique y such that sinh(y) = x</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.atan.html" title='js_sys::Math::atan fn'>atan</a></td><td class='docblock-short'><p>The <code>Math.atan()</code> 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</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.atan2.html" title='js_sys::Math::atan2 fn'>atan2</a></td><td class='docblock-short'><p>The <code>Math.atan2()</code> function returns the arctangent of the quotient of
its arguments.</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.atanh.html" title='js_sys::Math::atanh fn'>atanh</a></td><td class='docblock-short'><p>The <code>Math.atanh()</code> 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</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.cbrt.html" title='js_sys::Math::cbrt fn'>cbrt</a></td><td class='docblock-short'><p>The <code>Math.cbrt() </code>function returns the cube root of a number, that is
Math.cbrt(x) = ∛x = the unique y such that y^3 = x</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.ceil.html" title='js_sys::Math::ceil fn'>ceil</a></td><td class='docblock-short'><p>The <code>Math.ceil()</code> function returns the smallest integer greater than
or equal to a given number.</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.clz32.html" title='js_sys::Math::clz32 fn'>clz32</a></td><td class='docblock-short'><p>The <code>Math.clz32()</code> function returns the number of leading zero bits in
the 32-bit binary representation of a number.</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.cos.html" title='js_sys::Math::cos fn'>cos</a></td><td class='docblock-short'><p>The <code>Math.cos()</code> static function returns the cosine of the specified angle,
which must be specified in radians. This value is length(adjacent)/length(hypotenuse).</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.cosh.html" title='js_sys::Math::cosh fn'>cosh</a></td><td class='docblock-short'><p>The <code>Math.cosh()</code> function returns the hyperbolic cosine of a number,
that can be expressed using the constant e.</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.exp.html" title='js_sys::Math::exp fn'>exp</a></td><td class='docblock-short'><p>The <code>Math.exp()</code> 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.</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.expm1.html" title='js_sys::Math::expm1 fn'>expm1</a></td><td class='docblock-short'><p>The <code>Math.expm1()</code> function returns e^x - 1, where x is the argument, and e the base of the
natural logarithms.</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.floor.html" title='js_sys::Math::floor fn'>floor</a></td><td class='docblock-short'><p>The <code>Math.floor()</code> function returns the largest integer less than or
equal to a given number.</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.fround.html" title='js_sys::Math::fround fn'>fround</a></td><td class='docblock-short'><p>The <code>Math.fround()</code> function returns the nearest 32-bit single precision float representation
of a Number.</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.hypot.html" title='js_sys::Math::hypot fn'>hypot</a></td><td class='docblock-short'><p>The <code>Math.hypot()</code> function returns the square root of the sum of squares of its arguments.</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.imul.html" title='js_sys::Math::imul fn'>imul</a></td><td class='docblock-short'><p>The <code>Math.imul()</code> function returns the result of the C-like 32-bit multiplication of the
two parameters.</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.log.html" title='js_sys::Math::log fn'>log</a></td><td class='docblock-short'><p>The <code>Math.log()</code> function returns the natural logarithm (base e) of a number.
The JavaScript <code>Math.log()</code> function is equivalent to ln(x) in mathematics.</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.log1p.html" title='js_sys::Math::log1p fn'>log1p</a></td><td class='docblock-short'><p>The <code>Math.log1p()</code> function returns the natural logarithm (base e) of 1 + a number.
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log1p">MDN documentation</a></p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.log2.html" title='js_sys::Math::log2 fn'>log2</a></td><td class='docblock-short'><p>The <code>Math.log2()</code> function returns the base 2 logarithm of a number.</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.log10.html" title='js_sys::Math::log10 fn'>log10</a></td><td class='docblock-short'><p>The <code>Math.log10()</code> function returns the base 10 logarithm of a number.</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.max.html" title='js_sys::Math::max fn'>max</a></td><td class='docblock-short'><p>The <code>Math.max()</code> function returns the largest of two numbers.</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.min.html" title='js_sys::Math::min fn'>min</a></td><td class='docblock-short'><p>The static function <code>Math.min()</code> returns the lowest-valued number passed into it.</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.pow.html" title='js_sys::Math::pow fn'>pow</a></td><td class='docblock-short'><p>The <code>Math.pow()</code> function returns the base to the exponent power, that is, base^exponent.</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.random.html" title='js_sys::Math::random fn'>random</a></td><td class='docblock-short'><p>The <code>Math.random()</code> function returns a floating-point, pseudo-random number
in the range 01 (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.</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.round.html" title='js_sys::Math::round fn'>round</a></td><td class='docblock-short'><p>The <code>Math.round()</code> function returns the value of a number rounded to the nearest integer.</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.sign.html" title='js_sys::Math::sign fn'>sign</a></td><td class='docblock-short'><p>The <code>Math.sign()</code> function returns the sign of a number, indicating whether the number is
positive, negative or zero.</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.sin.html" title='js_sys::Math::sin fn'>sin</a></td><td class='docblock-short'><p>The <code>Math.sin()</code> function returns the sine of a number.</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.sinh.html" title='js_sys::Math::sinh fn'>sinh</a></td><td class='docblock-short'><p>The <code>Math.sinh()</code> function returns the hyperbolic sine of a number, that can be expressed
using the constant e: Math.sinh(x) = (e^x - e^-x)/2</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.sqrt.html" title='js_sys::Math::sqrt fn'>sqrt</a></td><td class='docblock-short'><p>The <code>Math.sqrt()</code> 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</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.tan.html" title='js_sys::Math::tan fn'>tan</a></td><td class='docblock-short'><p>The <code>Math.tan()</code> function returns the tangent of a number.</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.tanh.html" title='js_sys::Math::tanh fn'>tanh</a></td><td class='docblock-short'><p>The <code>Math.tanh()</code> 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)</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.trunc.html" title='js_sys::Math::trunc fn'>trunc</a></td><td class='docblock-short'><p>The <code>Math.trunc()</code> function returns the integer part of a number by removing any fractional
digits.</p>
</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "js_sys";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>