Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-release > by-pkgid > 0c2243f8a1696816431e7210e991fa52 > files > 16494

rust-doc-1.35.0-1.mga7.armv7hl.rpm

<!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 `f64` primitive in crate `std`."><meta name="keywords" content="rust, rustlang, rust-lang, f64"><title>f64 - Rust</title><link rel="stylesheet" type="text/css" href="../normalize1.35.0.css"><link rel="stylesheet" type="text/css" href="../rustdoc1.35.0.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark1.35.0.css"><link rel="stylesheet" type="text/css" href="../light1.35.0.css" id="themeStyle"><script src="../storage1.35.0.js"></script><noscript><link rel="stylesheet" href="../noscript1.35.0.css"></noscript><link rel="shortcut icon" href="../favicon1.35.0.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow1.35.0.svg");}</style></head><body class="rustdoc primitive"><!--[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='../std/index.html'><img src='../rust-logo1.35.0.png' alt='logo' width='100'></a><p class='location'>Primitive Type f64</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.abs">abs</a><a href="#method.abs_sub">abs_sub</a><a href="#method.acos">acos</a><a href="#method.acosh">acosh</a><a href="#method.asin">asin</a><a href="#method.asinh">asinh</a><a href="#method.atan">atan</a><a href="#method.atan2">atan2</a><a href="#method.atanh">atanh</a><a href="#method.cbrt">cbrt</a><a href="#method.ceil">ceil</a><a href="#method.clamp">clamp</a><a href="#method.classify">classify</a><a href="#method.copysign">copysign</a><a href="#method.cos">cos</a><a href="#method.cosh">cosh</a><a href="#method.div_euclid">div_euclid</a><a href="#method.exp">exp</a><a href="#method.exp2">exp2</a><a href="#method.exp_m1">exp_m1</a><a href="#method.floor">floor</a><a href="#method.fract">fract</a><a href="#method.from_bits">from_bits</a><a href="#method.hypot">hypot</a><a href="#method.is_finite">is_finite</a><a href="#method.is_infinite">is_infinite</a><a href="#method.is_nan">is_nan</a><a href="#method.is_normal">is_normal</a><a href="#method.is_sign_negative">is_sign_negative</a><a href="#method.is_sign_positive">is_sign_positive</a><a href="#method.ln">ln</a><a href="#method.ln_1p">ln_1p</a><a href="#method.log">log</a><a href="#method.log10">log10</a><a href="#method.log2">log2</a><a href="#method.max">max</a><a href="#method.min">min</a><a href="#method.mul_add">mul_add</a><a href="#method.powf">powf</a><a href="#method.powi">powi</a><a href="#method.recip">recip</a><a href="#method.rem_euclid">rem_euclid</a><a href="#method.round">round</a><a href="#method.signum">signum</a><a href="#method.sin">sin</a><a href="#method.sin_cos">sin_cos</a><a href="#method.sinh">sinh</a><a href="#method.sqrt">sqrt</a><a href="#method.tan">tan</a><a href="#method.tanh">tanh</a><a href="#method.to_bits">to_bits</a><a href="#method.to_degrees">to_degrees</a><a href="#method.to_radians">to_radians</a><a href="#method.trunc">trunc</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Add%3C%26%27_%20f64%3E">Add&lt;&amp;&#39;_ f64&gt;</a><a href="#impl-Add%3Cf64%3E">Add&lt;f64&gt;</a><a href="#impl-AddAssign%3C%26%27_%20f64%3E">AddAssign&lt;&amp;&#39;_ f64&gt;</a><a href="#impl-AddAssign%3Cf64%3E">AddAssign&lt;f64&gt;</a><a href="#impl-Clone">Clone</a><a href="#impl-Copy">Copy</a><a href="#impl-Debug">Debug</a><a href="#impl-Default">Default</a><a href="#impl-Display">Display</a><a href="#impl-Div%3C%26%27_%20f64%3E">Div&lt;&amp;&#39;_ f64&gt;</a><a href="#impl-Div%3Cf64%3E">Div&lt;f64&gt;</a><a href="#impl-DivAssign%3C%26%27_%20f64%3E">DivAssign&lt;&amp;&#39;_ f64&gt;</a><a href="#impl-DivAssign%3Cf64%3E">DivAssign&lt;f64&gt;</a><a href="#impl-From%3Cf32%3E">From&lt;f32&gt;</a><a href="#impl-From%3Ci16%3E">From&lt;i16&gt;</a><a href="#impl-From%3Ci32%3E">From&lt;i32&gt;</a><a href="#impl-From%3Ci8%3E">From&lt;i8&gt;</a><a href="#impl-From%3Cu16%3E">From&lt;u16&gt;</a><a href="#impl-From%3Cu32%3E">From&lt;u32&gt;</a><a href="#impl-From%3Cu8%3E">From&lt;u8&gt;</a><a href="#impl-FromStr">FromStr</a><a href="#impl-LowerExp">LowerExp</a><a href="#impl-Mul%3C%26%27_%20f64%3E">Mul&lt;&amp;&#39;_ f64&gt;</a><a href="#impl-Mul%3Cf64%3E">Mul&lt;f64&gt;</a><a href="#impl-MulAssign%3C%26%27_%20f64%3E">MulAssign&lt;&amp;&#39;_ f64&gt;</a><a href="#impl-MulAssign%3Cf64%3E">MulAssign&lt;f64&gt;</a><a href="#impl-Neg">Neg</a><a href="#impl-PartialEq%3Cf64%3E">PartialEq&lt;f64&gt;</a><a href="#impl-PartialOrd%3Cf64%3E">PartialOrd&lt;f64&gt;</a><a href="#impl-Product%3C%26%27a%20f64%3E">Product&lt;&amp;&#39;a f64&gt;</a><a href="#impl-Product%3Cf64%3E">Product&lt;f64&gt;</a><a href="#impl-Rem%3C%26%27_%20f64%3E">Rem&lt;&amp;&#39;_ f64&gt;</a><a href="#impl-Rem%3Cf64%3E">Rem&lt;f64&gt;</a><a href="#impl-RemAssign%3C%26%27_%20f64%3E">RemAssign&lt;&amp;&#39;_ f64&gt;</a><a href="#impl-RemAssign%3Cf64%3E">RemAssign&lt;f64&gt;</a><a href="#impl-Sub%3C%26%27_%20f64%3E">Sub&lt;&amp;&#39;_ f64&gt;</a><a href="#impl-Sub%3Cf64%3E">Sub&lt;f64&gt;</a><a href="#impl-SubAssign%3C%26%27_%20f64%3E">SubAssign&lt;&amp;&#39;_ f64&gt;</a><a href="#impl-SubAssign%3Cf64%3E">SubAssign&lt;f64&gt;</a><a href="#impl-Sum%3C%26%27a%20f64%3E">Sum&lt;&amp;&#39;a f64&gt;</a><a href="#impl-Sum%3Cf64%3E">Sum&lt;f64&gt;</a><a href="#impl-UpperExp">UpperExp</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow">Borrow</a><a href="#impl-BorrowMut">BorrowMut</a><a href="#impl-From">From</a><a href="#impl-Into">Into</a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-ToString">ToString</a><a href="#impl-TryFrom">TryFrom</a><a href="#impl-TryInto">TryInto</a></div></div><p class='location'><a href='index.html'>std</a></p><script>window.sidebarCurrent = {name: 'f64', ty: 'primitive', 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="../brush1.35.0.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme1.35.0.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" 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="../wheel1.35.0.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>&#x2212;</span>]</a></span></span><span class='in-band'>Primitive Type <a class="primitive" href=''>f64</a></span></h1><div class='docblock'><p>The 64-bit floating point type.</p>
<p><em><a href="f64/index.html">See also the <code>std::f64</code> module</a>.</em></p>
</div><h2 id='methods' class='small-section-header'>Methods<a href='#methods' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../src/std/f64.rs.html#29-939' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.floor' class="method"><code id='floor.v'>pub fn <a href='#method.floor' class='fnname'>floor</a>(self) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/std/f64.rs.html#45-47' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the largest integer less than or equal to a number.</p>
<h1 id="examples" class="section-header"><a href="#examples">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">f</span> <span class="op">=</span> <span class="number">3.7_f64</span>;
<span class="kw">let</span> <span class="ident">g</span> <span class="op">=</span> <span class="number">3.0_f64</span>;
<span class="kw">let</span> <span class="ident">h</span> <span class="op">=</span> <span class="op">-</span><span class="number">3.7_f64</span>;

<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">f</span>.<span class="ident">floor</span>(), <span class="number">3.0</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">g</span>.<span class="ident">floor</span>(), <span class="number">3.0</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">h</span>.<span class="ident">floor</span>(), <span class="op">-</span><span class="number">4.0</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Alet%20f%20%3D%203.7_f64%3B%0Alet%20g%20%3D%203.0_f64%3B%0Alet%20h%20%3D%20-3.7_f64%3B%0A%0Aassert_eq!(f.floor()%2C%203.0)%3B%0Aassert_eq!(g.floor()%2C%203.0)%3B%0Aassert_eq!(h.floor()%2C%20-4.0)%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.ceil' class="method"><code id='ceil.v'>pub fn <a href='#method.ceil' class='fnname'>ceil</a>(self) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/std/f64.rs.html#62-64' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the smallest integer greater than or equal to a number.</p>
<h1 id="examples-1" class="section-header"><a href="#examples-1">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">f</span> <span class="op">=</span> <span class="number">3.01_f64</span>;
<span class="kw">let</span> <span class="ident">g</span> <span class="op">=</span> <span class="number">4.0_f64</span>;

<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">f</span>.<span class="ident">ceil</span>(), <span class="number">4.0</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">g</span>.<span class="ident">ceil</span>(), <span class="number">4.0</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Alet%20f%20%3D%203.01_f64%3B%0Alet%20g%20%3D%204.0_f64%3B%0A%0Aassert_eq!(f.ceil()%2C%204.0)%3B%0Aassert_eq!(g.ceil()%2C%204.0)%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.round' class="method"><code id='round.v'>pub fn <a href='#method.round' class='fnname'>round</a>(self) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/std/f64.rs.html#80-82' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the nearest integer to a number. Round half-way cases away from
<code>0.0</code>.</p>
<h1 id="examples-2" class="section-header"><a href="#examples-2">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">f</span> <span class="op">=</span> <span class="number">3.3_f64</span>;
<span class="kw">let</span> <span class="ident">g</span> <span class="op">=</span> <span class="op">-</span><span class="number">3.3_f64</span>;

<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">f</span>.<span class="ident">round</span>(), <span class="number">3.0</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">g</span>.<span class="ident">round</span>(), <span class="op">-</span><span class="number">3.0</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Alet%20f%20%3D%203.3_f64%3B%0Alet%20g%20%3D%20-3.3_f64%3B%0A%0Aassert_eq!(f.round()%2C%203.0)%3B%0Aassert_eq!(g.round()%2C%20-3.0)%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.trunc' class="method"><code id='trunc.v'>pub fn <a href='#method.trunc' class='fnname'>trunc</a>(self) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/std/f64.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the integer part of a number.</p>
<h1 id="examples-3" class="section-header"><a href="#examples-3">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">f</span> <span class="op">=</span> <span class="number">3.7_f64</span>;
<span class="kw">let</span> <span class="ident">g</span> <span class="op">=</span> <span class="number">3.0_f64</span>;
<span class="kw">let</span> <span class="ident">h</span> <span class="op">=</span> <span class="op">-</span><span class="number">3.7_f64</span>;

<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">f</span>.<span class="ident">trunc</span>(), <span class="number">3.0</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">g</span>.<span class="ident">trunc</span>(), <span class="number">3.0</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">h</span>.<span class="ident">trunc</span>(), <span class="op">-</span><span class="number">3.0</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Alet%20f%20%3D%203.7_f64%3B%0Alet%20g%20%3D%203.0_f64%3B%0Alet%20h%20%3D%20-3.7_f64%3B%0A%0Aassert_eq!(f.trunc()%2C%203.0)%3B%0Aassert_eq!(g.trunc()%2C%203.0)%3B%0Aassert_eq!(h.trunc()%2C%20-3.0)%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.fract' class="method"><code id='fract.v'>pub fn <a href='#method.fract' class='fnname'>fract</a>(self) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/std/f64.rs.html#118' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the fractional part of a number.</p>
<h1 id="examples-4" class="section-header"><a href="#examples-4">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">x</span> <span class="op">=</span> <span class="number">3.5_f64</span>;
<span class="kw">let</span> <span class="ident">y</span> <span class="op">=</span> <span class="op">-</span><span class="number">3.5_f64</span>;
<span class="kw">let</span> <span class="ident">abs_difference_x</span> <span class="op">=</span> (<span class="ident">x</span>.<span class="ident">fract</span>() <span class="op">-</span> <span class="number">0.5</span>).<span class="ident">abs</span>();
<span class="kw">let</span> <span class="ident">abs_difference_y</span> <span class="op">=</span> (<span class="ident">y</span>.<span class="ident">fract</span>() <span class="op">-</span> (<span class="op">-</span><span class="number">0.5</span>)).<span class="ident">abs</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">abs_difference_x</span> <span class="op">&lt;</span> <span class="number">1e-10</span>);
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">abs_difference_y</span> <span class="op">&lt;</span> <span class="number">1e-10</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Alet%20x%20%3D%203.5_f64%3B%0Alet%20y%20%3D%20-3.5_f64%3B%0Alet%20abs_difference_x%20%3D%20(x.fract()%20-%200.5).abs()%3B%0Alet%20abs_difference_y%20%3D%20(y.fract()%20-%20(-0.5)).abs()%3B%0A%0Aassert!(abs_difference_x%20%3C%201e-10)%3B%0Aassert!(abs_difference_y%20%3C%201e-10)%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.abs' class="method"><code id='abs.v'>pub fn <a href='#method.abs' class='fnname'>abs</a>(self) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/std/f64.rs.html#141-143' title='goto source code'>[src]</a></h4><div class='docblock'><p>Computes the absolute value of <code>self</code>. Returns <code>NAN</code> if the
number is <code>NAN</code>.</p>
<h1 id="examples-5" class="section-header"><a href="#examples-5">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">f64</span>;

<span class="kw">let</span> <span class="ident">x</span> <span class="op">=</span> <span class="number">3.5_f64</span>;
<span class="kw">let</span> <span class="ident">y</span> <span class="op">=</span> <span class="op">-</span><span class="number">3.5_f64</span>;

<span class="kw">let</span> <span class="ident">abs_difference_x</span> <span class="op">=</span> (<span class="ident">x</span>.<span class="ident">abs</span>() <span class="op">-</span> <span class="ident">x</span>).<span class="ident">abs</span>();
<span class="kw">let</span> <span class="ident">abs_difference_y</span> <span class="op">=</span> (<span class="ident">y</span>.<span class="ident">abs</span>() <span class="op">-</span> (<span class="op">-</span><span class="ident">y</span>)).<span class="ident">abs</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">abs_difference_x</span> <span class="op">&lt;</span> <span class="number">1e-10</span>);
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">abs_difference_y</span> <span class="op">&lt;</span> <span class="number">1e-10</span>);

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">f64</span>::<span class="ident">NAN</span>.<span class="ident">abs</span>().<span class="ident">is_nan</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Af64%3B%0A%0Alet%20x%20%3D%203.5_f64%3B%0Alet%20y%20%3D%20-3.5_f64%3B%0A%0Alet%20abs_difference_x%20%3D%20(x.abs()%20-%20x).abs()%3B%0Alet%20abs_difference_y%20%3D%20(y.abs()%20-%20(-y)).abs()%3B%0A%0Aassert!(abs_difference_x%20%3C%201e-10)%3B%0Aassert!(abs_difference_y%20%3C%201e-10)%3B%0A%0Aassert!(f64%3A%3ANAN.abs().is_nan())%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.signum' class="method"><code id='signum.v'>pub fn <a href='#method.signum' class='fnname'>signum</a>(self) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/std/f64.rs.html#165-171' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns a number that represents the sign of <code>self</code>.</p>
<ul>
<li><code>1.0</code> if the number is positive, <code>+0.0</code> or <code>INFINITY</code></li>
<li><code>-1.0</code> if the number is negative, <code>-0.0</code> or <code>NEG_INFINITY</code></li>
<li><code>NAN</code> if the number is <code>NAN</code></li>
</ul>
<h1 id="examples-6" class="section-header"><a href="#examples-6">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">f64</span>;

<span class="kw">let</span> <span class="ident">f</span> <span class="op">=</span> <span class="number">3.5_f64</span>;

<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">f</span>.<span class="ident">signum</span>(), <span class="number">1.0</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">f64</span>::<span class="ident">NEG_INFINITY</span>.<span class="ident">signum</span>(), <span class="op">-</span><span class="number">1.0</span>);

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">f64</span>::<span class="ident">NAN</span>.<span class="ident">signum</span>().<span class="ident">is_nan</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Af64%3B%0A%0Alet%20f%20%3D%203.5_f64%3B%0A%0Aassert_eq!(f.signum()%2C%201.0)%3B%0Aassert_eq!(f64%3A%3ANEG_INFINITY.signum()%2C%20-1.0)%3B%0A%0Aassert!(f64%3A%3ANAN.signum().is_nan())%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.copysign' class="method"><code id='copysign.v'><div class="docblock attributes">#[must_use]
</div>pub fn <a href='#method.copysign' class='fnname'>copysign</a>(self, sign: <a class="primitive" href="primitive.f64.html">f64</a>) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><div class='since' title='Stable since Rust version 1.35.0'>1.35.0</div><a class='srclink' href='../src/std/f64.rs.html#197-199' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns a number composed of the magnitude of <code>self</code> and the sign of
<code>sign</code>.</p>
<p>Equal to <code>self</code> if the sign of <code>self</code> and <code>sign</code> are the same, otherwise
equal to <code>-self</code>. If <code>self</code> is a <code>NAN</code>, then a <code>NAN</code> with the sign of
<code>sign</code> is returned.</p>
<h1 id="examples-7" class="section-header"><a href="#examples-7">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">f64</span>;

<span class="kw">let</span> <span class="ident">f</span> <span class="op">=</span> <span class="number">3.5_f64</span>;

<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">f</span>.<span class="ident">copysign</span>(<span class="number">0.42</span>), <span class="number">3.5_f64</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">f</span>.<span class="ident">copysign</span>(<span class="op">-</span><span class="number">0.42</span>), <span class="op">-</span><span class="number">3.5_f64</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>((<span class="op">-</span><span class="ident">f</span>).<span class="ident">copysign</span>(<span class="number">0.42</span>), <span class="number">3.5_f64</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>((<span class="op">-</span><span class="ident">f</span>).<span class="ident">copysign</span>(<span class="op">-</span><span class="number">0.42</span>), <span class="op">-</span><span class="number">3.5_f64</span>);

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">f64</span>::<span class="ident">NAN</span>.<span class="ident">copysign</span>(<span class="number">1.0</span>).<span class="ident">is_nan</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Af64%3B%0A%0Alet%20f%20%3D%203.5_f64%3B%0A%0Aassert_eq!(f.copysign(0.42)%2C%203.5_f64)%3B%0Aassert_eq!(f.copysign(-0.42)%2C%20-3.5_f64)%3B%0Aassert_eq!((-f).copysign(0.42)%2C%203.5_f64)%3B%0Aassert_eq!((-f).copysign(-0.42)%2C%20-3.5_f64)%3B%0A%0Aassert!(f64%3A%3ANAN.copysign(1.0).is_nan())%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.mul_add' class="method"><code id='mul_add.v'>pub fn <a href='#method.mul_add' class='fnname'>mul_add</a>(self, a: <a class="primitive" href="primitive.f64.html">f64</a>, b: <a class="primitive" href="primitive.f64.html">f64</a>) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/std/f64.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock'><p>Fused multiply-add. Computes <code>(self * a) + b</code> with only one rounding
error, yielding a more accurate result than an unfused multiply-add.</p>
<p>Using <code>mul_add</code> can be more performant than an unfused multiply-add if
the target architecture has a dedicated <code>fma</code> CPU instruction.</p>
<h1 id="examples-8" class="section-header"><a href="#examples-8">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">m</span> <span class="op">=</span> <span class="number">10.0_f64</span>;
<span class="kw">let</span> <span class="ident">x</span> <span class="op">=</span> <span class="number">4.0_f64</span>;
<span class="kw">let</span> <span class="ident">b</span> <span class="op">=</span> <span class="number">60.0_f64</span>;

<span class="comment">// 100.0</span>
<span class="kw">let</span> <span class="ident">abs_difference</span> <span class="op">=</span> (<span class="ident">m</span>.<span class="ident">mul_add</span>(<span class="ident">x</span>, <span class="ident">b</span>) <span class="op">-</span> (<span class="ident">m</span><span class="kw-2">*</span><span class="ident">x</span> <span class="op">+</span> <span class="ident">b</span>)).<span class="ident">abs</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">abs_difference</span> <span class="op">&lt;</span> <span class="number">1e-10</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Alet%20m%20%3D%2010.0_f64%3B%0Alet%20x%20%3D%204.0_f64%3B%0Alet%20b%20%3D%2060.0_f64%3B%0A%0A%2F%2F%20100.0%0Alet%20abs_difference%20%3D%20(m.mul_add(x%2C%20b)%20-%20(m*x%20%2B%20b)).abs()%3B%0A%0Aassert!(abs_difference%20%3C%201e-10)%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.div_euclid' class="method"><code id='div_euclid.v'>pub fn <a href='#method.div_euclid' class='fnname'>div_euclid</a>(self, rhs: <a class="primitive" href="primitive.f64.html">f64</a>) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/std/f64.rs.html#245-251' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>euclidean_division</code>&nbsp;<a href="https://github.com/rust-lang/rust/issues/49048">#49048</a>)</div></div><div class='docblock'><p>Calculates Euclidean division, the matching method for <code>rem_euclid</code>.</p>
<p>This computes the integer <code>n</code> such that
<code>self = n * rhs + self.rem_euclid(rhs)</code>.
In other words, the result is <code>self / rhs</code> rounded to the integer <code>n</code>
such that <code>self &gt;= n * rhs</code>.</p>
<h1 id="examples-9" class="section-header"><a href="#examples-9">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="attribute">#![<span class="ident">feature</span>(<span class="ident">euclidean_division</span>)]</span>
<span class="kw">let</span> <span class="ident">a</span>: <span class="ident">f64</span> <span class="op">=</span> <span class="number">7.0</span>;
<span class="kw">let</span> <span class="ident">b</span> <span class="op">=</span> <span class="number">4.0</span>;
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">a</span>.<span class="ident">div_euclid</span>(<span class="ident">b</span>), <span class="number">1.0</span>); <span class="comment">// 7.0 &gt; 4.0 * 1.0</span>
<span class="macro">assert_eq</span><span class="macro">!</span>((<span class="op">-</span><span class="ident">a</span>).<span class="ident">div_euclid</span>(<span class="ident">b</span>), <span class="op">-</span><span class="number">2.0</span>); <span class="comment">// -7.0 &gt;= 4.0 * -2.0</span>
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">a</span>.<span class="ident">div_euclid</span>(<span class="op">-</span><span class="ident">b</span>), <span class="op">-</span><span class="number">1.0</span>); <span class="comment">// 7.0 &gt;= -4.0 * -1.0</span>
<span class="macro">assert_eq</span><span class="macro">!</span>((<span class="op">-</span><span class="ident">a</span>).<span class="ident">div_euclid</span>(<span class="op">-</span><span class="ident">b</span>), <span class="number">2.0</span>); <span class="comment">// -7.0 &gt;= -4.0 * 2.0</span><a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0A%23!%5Bfeature(euclidean_division)%5D%0Afn%20main()%20%7B%0Alet%20a%3A%20f64%20%3D%207.0%3B%0Alet%20b%20%3D%204.0%3B%0Aassert_eq!(a.div_euclid(b)%2C%201.0)%3B%20%2F%2F%207.0%20%3E%204.0%20*%201.0%0Aassert_eq!((-a).div_euclid(b)%2C%20-2.0)%3B%20%2F%2F%20-7.0%20%3E%3D%204.0%20*%20-2.0%0Aassert_eq!(a.div_euclid(-b)%2C%20-1.0)%3B%20%2F%2F%207.0%20%3E%3D%20-4.0%20*%20-1.0%0Aassert_eq!((-a).div_euclid(-b)%2C%202.0)%3B%20%2F%2F%20-7.0%20%3E%3D%20-4.0%20*%202.0%0A%7D&amp;version=nightly">Run</a></pre></div>
</div><h4 id='method.rem_euclid' class="method"><code id='rem_euclid.v'>pub fn <a href='#method.rem_euclid' class='fnname'>rem_euclid</a>(self, rhs: <a class="primitive" href="primitive.f64.html">f64</a>) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/std/f64.rs.html#279-286' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>euclidean_division</code>&nbsp;<a href="https://github.com/rust-lang/rust/issues/49048">#49048</a>)</div></div><div class='docblock'><p>Calculates the least nonnegative remainder of <code>self (mod rhs)</code>.</p>
<p>In particular, the return value <code>r</code> satisfies <code>0.0 &lt;= r &lt; rhs.abs()</code> in
most cases. However, due to a floating point round-off error it can
result in <code>r == rhs.abs()</code>, violating the mathematical definition, if
<code>self</code> is much smaller than <code>rhs.abs()</code> in magnitude and <code>self &lt; 0.0</code>.
This result is not an element of the function's codomain, but it is the
closest floating point number in the real numbers and thus fulfills the
property <code>self == self.div_euclid(rhs) * rhs + self.rem_euclid(rhs)</code>
approximatively.</p>
<h1 id="examples-10" class="section-header"><a href="#examples-10">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="attribute">#![<span class="ident">feature</span>(<span class="ident">euclidean_division</span>)]</span>
<span class="kw">let</span> <span class="ident">a</span>: <span class="ident">f64</span> <span class="op">=</span> <span class="number">7.0</span>;
<span class="kw">let</span> <span class="ident">b</span> <span class="op">=</span> <span class="number">4.0</span>;
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">a</span>.<span class="ident">rem_euclid</span>(<span class="ident">b</span>), <span class="number">3.0</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>((<span class="op">-</span><span class="ident">a</span>).<span class="ident">rem_euclid</span>(<span class="ident">b</span>), <span class="number">1.0</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">a</span>.<span class="ident">rem_euclid</span>(<span class="op">-</span><span class="ident">b</span>), <span class="number">3.0</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>((<span class="op">-</span><span class="ident">a</span>).<span class="ident">rem_euclid</span>(<span class="op">-</span><span class="ident">b</span>), <span class="number">1.0</span>);
<span class="comment">// limitation due to round-off error</span>
<span class="macro">assert</span><span class="macro">!</span>((<span class="op">-</span><span class="ident">std</span>::<span class="ident">f64</span>::<span class="ident">EPSILON</span>).<span class="ident">rem_euclid</span>(<span class="number">3.0</span>) <span class="op">!=</span> <span class="number">0.0</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0A%23!%5Bfeature(euclidean_division)%5D%0Afn%20main()%20%7B%0Alet%20a%3A%20f64%20%3D%207.0%3B%0Alet%20b%20%3D%204.0%3B%0Aassert_eq!(a.rem_euclid(b)%2C%203.0)%3B%0Aassert_eq!((-a).rem_euclid(b)%2C%201.0)%3B%0Aassert_eq!(a.rem_euclid(-b)%2C%203.0)%3B%0Aassert_eq!((-a).rem_euclid(-b)%2C%201.0)%3B%0A%2F%2F%20limitation%20due%20to%20round-off%20error%0Aassert!((-std%3A%3Af64%3A%3AEPSILON).rem_euclid(3.0)%20!%3D%200.0)%3B%0A%7D&amp;version=nightly">Run</a></pre></div>
</div><h4 id='method.powi' class="method"><code id='powi.v'>pub fn <a href='#method.powi' class='fnname'>powi</a>(self, n: <a class="primitive" href="primitive.i32.html">i32</a>) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/std/f64.rs.html#302-304' title='goto source code'>[src]</a></h4><div class='docblock'><p>Raises a number to an integer power.</p>
<p>Using this function is generally faster than using <code>powf</code></p>
<h1 id="examples-11" class="section-header"><a href="#examples-11">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">x</span> <span class="op">=</span> <span class="number">2.0_f64</span>;
<span class="kw">let</span> <span class="ident">abs_difference</span> <span class="op">=</span> (<span class="ident">x</span>.<span class="ident">powi</span>(<span class="number">2</span>) <span class="op">-</span> <span class="ident">x</span><span class="kw-2">*</span><span class="ident">x</span>).<span class="ident">abs</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">abs_difference</span> <span class="op">&lt;</span> <span class="number">1e-10</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Alet%20x%20%3D%202.0_f64%3B%0Alet%20abs_difference%20%3D%20(x.powi(2)%20-%20x*x).abs()%3B%0A%0Aassert!(abs_difference%20%3C%201e-10)%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.powf' class="method"><code id='powf.v'>pub fn <a href='#method.powf' class='fnname'>powf</a>(self, n: <a class="primitive" href="primitive.f64.html">f64</a>) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/std/f64.rs.html#318-320' title='goto source code'>[src]</a></h4><div class='docblock'><p>Raises a number to a floating point power.</p>
<h1 id="examples-12" class="section-header"><a href="#examples-12">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">x</span> <span class="op">=</span> <span class="number">2.0_f64</span>;
<span class="kw">let</span> <span class="ident">abs_difference</span> <span class="op">=</span> (<span class="ident">x</span>.<span class="ident">powf</span>(<span class="number">2.0</span>) <span class="op">-</span> <span class="ident">x</span><span class="kw-2">*</span><span class="ident">x</span>).<span class="ident">abs</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">abs_difference</span> <span class="op">&lt;</span> <span class="number">1e-10</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Alet%20x%20%3D%202.0_f64%3B%0Alet%20abs_difference%20%3D%20(x.powf(2.0)%20-%20x*x).abs()%3B%0A%0Aassert!(abs_difference%20%3C%201e-10)%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.sqrt' class="method"><code id='sqrt.v'>pub fn <a href='#method.sqrt' class='fnname'>sqrt</a>(self) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/std/f64.rs.html#339-345' title='goto source code'>[src]</a></h4><div class='docblock'><p>Takes the square root of a number.</p>
<p>Returns NaN if <code>self</code> is a negative number.</p>
<h1 id="examples-13" class="section-header"><a href="#examples-13">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">positive</span> <span class="op">=</span> <span class="number">4.0_f64</span>;
<span class="kw">let</span> <span class="ident">negative</span> <span class="op">=</span> <span class="op">-</span><span class="number">4.0_f64</span>;

<span class="kw">let</span> <span class="ident">abs_difference</span> <span class="op">=</span> (<span class="ident">positive</span>.<span class="ident">sqrt</span>() <span class="op">-</span> <span class="number">2.0</span>).<span class="ident">abs</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">abs_difference</span> <span class="op">&lt;</span> <span class="number">1e-10</span>);
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">negative</span>.<span class="ident">sqrt</span>().<span class="ident">is_nan</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Alet%20positive%20%3D%204.0_f64%3B%0Alet%20negative%20%3D%20-4.0_f64%3B%0A%0Alet%20abs_difference%20%3D%20(positive.sqrt()%20-%202.0).abs()%3B%0A%0Aassert!(abs_difference%20%3C%201e-10)%3B%0Aassert!(negative.sqrt().is_nan())%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.exp' class="method"><code id='exp.v'>pub fn <a href='#method.exp' class='fnname'>exp</a>(self) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/std/f64.rs.html#363-365' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns <code>e^(self)</code>, (the exponential function).</p>
<h1 id="examples-14" class="section-header"><a href="#examples-14">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">one</span> <span class="op">=</span> <span class="number">1.0_f64</span>;
<span class="comment">// e^1</span>
<span class="kw">let</span> <span class="ident">e</span> <span class="op">=</span> <span class="ident">one</span>.<span class="ident">exp</span>();

<span class="comment">// ln(e) - 1 == 0</span>
<span class="kw">let</span> <span class="ident">abs_difference</span> <span class="op">=</span> (<span class="ident">e</span>.<span class="ident">ln</span>() <span class="op">-</span> <span class="number">1.0</span>).<span class="ident">abs</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">abs_difference</span> <span class="op">&lt;</span> <span class="number">1e-10</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Alet%20one%20%3D%201.0_f64%3B%0A%2F%2F%20e%5E1%0Alet%20e%20%3D%20one.exp()%3B%0A%0A%2F%2F%20ln(e)%20-%201%20%3D%3D%200%0Alet%20abs_difference%20%3D%20(e.ln()%20-%201.0).abs()%3B%0A%0Aassert!(abs_difference%20%3C%201e-10)%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.exp2' class="method"><code id='exp2.v'>pub fn <a href='#method.exp2' class='fnname'>exp2</a>(self) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/std/f64.rs.html#381-383' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns <code>2^(self)</code>.</p>
<h1 id="examples-15" class="section-header"><a href="#examples-15">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">f</span> <span class="op">=</span> <span class="number">2.0_f64</span>;

<span class="comment">// 2^2 - 4 == 0</span>
<span class="kw">let</span> <span class="ident">abs_difference</span> <span class="op">=</span> (<span class="ident">f</span>.<span class="ident">exp2</span>() <span class="op">-</span> <span class="number">4.0</span>).<span class="ident">abs</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">abs_difference</span> <span class="op">&lt;</span> <span class="number">1e-10</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Alet%20f%20%3D%202.0_f64%3B%0A%0A%2F%2F%202%5E2%20-%204%20%3D%3D%200%0Alet%20abs_difference%20%3D%20(f.exp2()%20-%204.0).abs()%3B%0A%0Aassert!(abs_difference%20%3C%201e-10)%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.ln' class="method"><code id='ln.v'>pub fn <a href='#method.ln' class='fnname'>ln</a>(self) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/std/f64.rs.html#401-403' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the natural logarithm of the number.</p>
<h1 id="examples-16" class="section-header"><a href="#examples-16">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">one</span> <span class="op">=</span> <span class="number">1.0_f64</span>;
<span class="comment">// e^1</span>
<span class="kw">let</span> <span class="ident">e</span> <span class="op">=</span> <span class="ident">one</span>.<span class="ident">exp</span>();

<span class="comment">// ln(e) - 1 == 0</span>
<span class="kw">let</span> <span class="ident">abs_difference</span> <span class="op">=</span> (<span class="ident">e</span>.<span class="ident">ln</span>() <span class="op">-</span> <span class="number">1.0</span>).<span class="ident">abs</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">abs_difference</span> <span class="op">&lt;</span> <span class="number">1e-10</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Alet%20one%20%3D%201.0_f64%3B%0A%2F%2F%20e%5E1%0Alet%20e%20%3D%20one.exp()%3B%0A%0A%2F%2F%20ln(e)%20-%201%20%3D%3D%200%0Alet%20abs_difference%20%3D%20(e.ln()%20-%201.0).abs()%3B%0A%0Aassert!(abs_difference%20%3C%201e-10)%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.log' class="method"><code id='log.v'>pub fn <a href='#method.log' class='fnname'>log</a>(self, base: <a class="primitive" href="primitive.f64.html">f64</a>) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/std/f64.rs.html#423' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the logarithm of the number with respect to an arbitrary base.</p>
<p>The result may not be correctly rounded owing to implementation details;
<code>self.log2()</code> can produce more accurate results for base 2, and
<code>self.log10()</code> can produce more accurate results for base 10.</p>
<h1 id="examples-17" class="section-header"><a href="#examples-17">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">five</span> <span class="op">=</span> <span class="number">5.0_f64</span>;

<span class="comment">// log5(5) - 1 == 0</span>
<span class="kw">let</span> <span class="ident">abs_difference</span> <span class="op">=</span> (<span class="ident">five</span>.<span class="ident">log</span>(<span class="number">5.0</span>) <span class="op">-</span> <span class="number">1.0</span>).<span class="ident">abs</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">abs_difference</span> <span class="op">&lt;</span> <span class="number">1e-10</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Alet%20five%20%3D%205.0_f64%3B%0A%0A%2F%2F%20log5(5)%20-%201%20%3D%3D%200%0Alet%20abs_difference%20%3D%20(five.log(5.0)%20-%201.0).abs()%3B%0A%0Aassert!(abs_difference%20%3C%201e-10)%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.log2' class="method"><code id='log2.v'>pub fn <a href='#method.log2' class='fnname'>log2</a>(self) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/std/f64.rs.html#439-446' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the base 2 logarithm of the number.</p>
<h1 id="examples-18" class="section-header"><a href="#examples-18">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">two</span> <span class="op">=</span> <span class="number">2.0_f64</span>;

<span class="comment">// log2(2) - 1 == 0</span>
<span class="kw">let</span> <span class="ident">abs_difference</span> <span class="op">=</span> (<span class="ident">two</span>.<span class="ident">log2</span>() <span class="op">-</span> <span class="number">1.0</span>).<span class="ident">abs</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">abs_difference</span> <span class="op">&lt;</span> <span class="number">1e-10</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Alet%20two%20%3D%202.0_f64%3B%0A%0A%2F%2F%20log2(2)%20-%201%20%3D%3D%200%0Alet%20abs_difference%20%3D%20(two.log2()%20-%201.0).abs()%3B%0A%0Aassert!(abs_difference%20%3C%201e-10)%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.log10' class="method"><code id='log10.v'>pub fn <a href='#method.log10' class='fnname'>log10</a>(self) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/std/f64.rs.html#462-464' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the base 10 logarithm of the number.</p>
<h1 id="examples-19" class="section-header"><a href="#examples-19">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">ten</span> <span class="op">=</span> <span class="number">10.0_f64</span>;

<span class="comment">// log10(10) - 1 == 0</span>
<span class="kw">let</span> <span class="ident">abs_difference</span> <span class="op">=</span> (<span class="ident">ten</span>.<span class="ident">log10</span>() <span class="op">-</span> <span class="number">1.0</span>).<span class="ident">abs</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">abs_difference</span> <span class="op">&lt;</span> <span class="number">1e-10</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Alet%20ten%20%3D%2010.0_f64%3B%0A%0A%2F%2F%20log10(10)%20-%201%20%3D%3D%200%0Alet%20abs_difference%20%3D%20(ten.log10()%20-%201.0).abs()%3B%0A%0Aassert!(abs_difference%20%3C%201e-10)%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.abs_sub' class="method"><code id='abs_sub.v'>pub fn <a href='#method.abs_sub' class='fnname'>abs_sub</a>(self, other: <a class="primitive" href="primitive.f64.html">f64</a>) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/std/f64.rs.html#493-495' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab deprecated'>Deprecated since 1.10.0: <p>you probably meant <code>(self - other).abs()</code>: this operation is <code>(self - other).max(0.0)</code> except that <code>abs_sub</code> also propagates NaNs (also known as <code>fdim</code> in C). If you truly need the positive difference, consider using that expression or the C function <code>fdim</code>, depending on how you wish to handle NaN (please consider filing an issue describing your use-case too).</p>
</div></div><div class='docblock'><p>The positive difference of two numbers.</p>
<ul>
<li>If <code>self &lt;= other</code>: <code>0:0</code></li>
<li>Else: <code>self - other</code></li>
</ul>
<h1 id="examples-20" class="section-header"><a href="#examples-20">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">x</span> <span class="op">=</span> <span class="number">3.0_f64</span>;
<span class="kw">let</span> <span class="ident">y</span> <span class="op">=</span> <span class="op">-</span><span class="number">3.0_f64</span>;

<span class="kw">let</span> <span class="ident">abs_difference_x</span> <span class="op">=</span> (<span class="ident">x</span>.<span class="ident">abs_sub</span>(<span class="number">1.0</span>) <span class="op">-</span> <span class="number">2.0</span>).<span class="ident">abs</span>();
<span class="kw">let</span> <span class="ident">abs_difference_y</span> <span class="op">=</span> (<span class="ident">y</span>.<span class="ident">abs_sub</span>(<span class="number">1.0</span>) <span class="op">-</span> <span class="number">0.0</span>).<span class="ident">abs</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">abs_difference_x</span> <span class="op">&lt;</span> <span class="number">1e-10</span>);
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">abs_difference_y</span> <span class="op">&lt;</span> <span class="number">1e-10</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Alet%20x%20%3D%203.0_f64%3B%0Alet%20y%20%3D%20-3.0_f64%3B%0A%0Alet%20abs_difference_x%20%3D%20(x.abs_sub(1.0)%20-%202.0).abs()%3B%0Alet%20abs_difference_y%20%3D%20(y.abs_sub(1.0)%20-%200.0).abs()%3B%0A%0Aassert!(abs_difference_x%20%3C%201e-10)%3B%0Aassert!(abs_difference_y%20%3C%201e-10)%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.cbrt' class="method"><code id='cbrt.v'>pub fn <a href='#method.cbrt' class='fnname'>cbrt</a>(self) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/std/f64.rs.html#511-513' title='goto source code'>[src]</a></h4><div class='docblock'><p>Takes the cubic root of a number.</p>
<h1 id="examples-21" class="section-header"><a href="#examples-21">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">x</span> <span class="op">=</span> <span class="number">8.0_f64</span>;

<span class="comment">// x^(1/3) - 2 == 0</span>
<span class="kw">let</span> <span class="ident">abs_difference</span> <span class="op">=</span> (<span class="ident">x</span>.<span class="ident">cbrt</span>() <span class="op">-</span> <span class="number">2.0</span>).<span class="ident">abs</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">abs_difference</span> <span class="op">&lt;</span> <span class="number">1e-10</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Alet%20x%20%3D%208.0_f64%3B%0A%0A%2F%2F%20x%5E(1%2F3)%20-%202%20%3D%3D%200%0Alet%20abs_difference%20%3D%20(x.cbrt()%20-%202.0).abs()%3B%0A%0Aassert!(abs_difference%20%3C%201e-10)%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.hypot' class="method"><code id='hypot.v'>pub fn <a href='#method.hypot' class='fnname'>hypot</a>(self, other: <a class="primitive" href="primitive.f64.html">f64</a>) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/std/f64.rs.html#531-533' title='goto source code'>[src]</a></h4><div class='docblock'><p>Calculates the length of the hypotenuse of a right-angle triangle given
legs of length <code>x</code> and <code>y</code>.</p>
<h1 id="examples-22" class="section-header"><a href="#examples-22">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">x</span> <span class="op">=</span> <span class="number">2.0_f64</span>;
<span class="kw">let</span> <span class="ident">y</span> <span class="op">=</span> <span class="number">3.0_f64</span>;

<span class="comment">// sqrt(x^2 + y^2)</span>
<span class="kw">let</span> <span class="ident">abs_difference</span> <span class="op">=</span> (<span class="ident">x</span>.<span class="ident">hypot</span>(<span class="ident">y</span>) <span class="op">-</span> (<span class="ident">x</span>.<span class="ident">powi</span>(<span class="number">2</span>) <span class="op">+</span> <span class="ident">y</span>.<span class="ident">powi</span>(<span class="number">2</span>)).<span class="ident">sqrt</span>()).<span class="ident">abs</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">abs_difference</span> <span class="op">&lt;</span> <span class="number">1e-10</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Alet%20x%20%3D%202.0_f64%3B%0Alet%20y%20%3D%203.0_f64%3B%0A%0A%2F%2F%20sqrt(x%5E2%20%2B%20y%5E2)%0Alet%20abs_difference%20%3D%20(x.hypot(y)%20-%20(x.powi(2)%20%2B%20y.powi(2)).sqrt()).abs()%3B%0A%0Aassert!(abs_difference%20%3C%201e-10)%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.sin' class="method"><code id='sin.v'>pub fn <a href='#method.sin' class='fnname'>sin</a>(self) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/std/f64.rs.html#550-552' title='goto source code'>[src]</a></h4><div class='docblock'><p>Computes the sine of a number (in radians).</p>
<h1 id="examples-23" class="section-header"><a href="#examples-23">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">f64</span>;

<span class="kw">let</span> <span class="ident">x</span> <span class="op">=</span> <span class="ident">f64</span>::<span class="ident">consts</span>::<span class="ident">PI</span><span class="op">/</span><span class="number">2.0</span>;

<span class="kw">let</span> <span class="ident">abs_difference</span> <span class="op">=</span> (<span class="ident">x</span>.<span class="ident">sin</span>() <span class="op">-</span> <span class="number">1.0</span>).<span class="ident">abs</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">abs_difference</span> <span class="op">&lt;</span> <span class="number">1e-10</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Af64%3B%0A%0Alet%20x%20%3D%20f64%3A%3Aconsts%3A%3API%2F2.0%3B%0A%0Alet%20abs_difference%20%3D%20(x.sin()%20-%201.0).abs()%3B%0A%0Aassert!(abs_difference%20%3C%201e-10)%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.cos' class="method"><code id='cos.v'>pub fn <a href='#method.cos' class='fnname'>cos</a>(self) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/std/f64.rs.html#569-571' title='goto source code'>[src]</a></h4><div class='docblock'><p>Computes the cosine of a number (in radians).</p>
<h1 id="examples-24" class="section-header"><a href="#examples-24">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">f64</span>;

<span class="kw">let</span> <span class="ident">x</span> <span class="op">=</span> <span class="number">2.0</span><span class="kw-2">*</span><span class="ident">f64</span>::<span class="ident">consts</span>::<span class="ident">PI</span>;

<span class="kw">let</span> <span class="ident">abs_difference</span> <span class="op">=</span> (<span class="ident">x</span>.<span class="ident">cos</span>() <span class="op">-</span> <span class="number">1.0</span>).<span class="ident">abs</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">abs_difference</span> <span class="op">&lt;</span> <span class="number">1e-10</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Af64%3B%0A%0Alet%20x%20%3D%202.0*f64%3A%3Aconsts%3A%3API%3B%0A%0Alet%20abs_difference%20%3D%20(x.cos()%20-%201.0).abs()%3B%0A%0Aassert!(abs_difference%20%3C%201e-10)%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.tan' class="method"><code id='tan.v'>pub fn <a href='#method.tan' class='fnname'>tan</a>(self) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/std/f64.rs.html#587-589' title='goto source code'>[src]</a></h4><div class='docblock'><p>Computes the tangent of a number (in radians).</p>
<h1 id="examples-25" class="section-header"><a href="#examples-25">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">f64</span>;

<span class="kw">let</span> <span class="ident">x</span> <span class="op">=</span> <span class="ident">f64</span>::<span class="ident">consts</span>::<span class="ident">PI</span><span class="op">/</span><span class="number">4.0</span>;
<span class="kw">let</span> <span class="ident">abs_difference</span> <span class="op">=</span> (<span class="ident">x</span>.<span class="ident">tan</span>() <span class="op">-</span> <span class="number">1.0</span>).<span class="ident">abs</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">abs_difference</span> <span class="op">&lt;</span> <span class="number">1e-14</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Af64%3B%0A%0Alet%20x%20%3D%20f64%3A%3Aconsts%3A%3API%2F4.0%3B%0Alet%20abs_difference%20%3D%20(x.tan()%20-%201.0).abs()%3B%0A%0Aassert!(abs_difference%20%3C%201e-14)%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.asin' class="method"><code id='asin.v'>pub fn <a href='#method.asin' class='fnname'>asin</a>(self) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/std/f64.rs.html#609-611' title='goto source code'>[src]</a></h4><div class='docblock'><p>Computes the arcsine of a number. Return value is in radians in
the range [-pi/2, pi/2] or NaN if the number is outside the range
[-1, 1].</p>
<h1 id="examples-26" class="section-header"><a href="#examples-26">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">f64</span>;

<span class="kw">let</span> <span class="ident">f</span> <span class="op">=</span> <span class="ident">f64</span>::<span class="ident">consts</span>::<span class="ident">PI</span> <span class="op">/</span> <span class="number">2.0</span>;

<span class="comment">// asin(sin(pi/2))</span>
<span class="kw">let</span> <span class="ident">abs_difference</span> <span class="op">=</span> (<span class="ident">f</span>.<span class="ident">sin</span>().<span class="ident">asin</span>() <span class="op">-</span> <span class="ident">f64</span>::<span class="ident">consts</span>::<span class="ident">PI</span> <span class="op">/</span> <span class="number">2.0</span>).<span class="ident">abs</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">abs_difference</span> <span class="op">&lt;</span> <span class="number">1e-10</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Af64%3B%0A%0Alet%20f%20%3D%20f64%3A%3Aconsts%3A%3API%20%2F%202.0%3B%0A%0A%2F%2F%20asin(sin(pi%2F2))%0Alet%20abs_difference%20%3D%20(f.sin().asin()%20-%20f64%3A%3Aconsts%3A%3API%20%2F%202.0).abs()%3B%0A%0Aassert!(abs_difference%20%3C%201e-10)%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.acos' class="method"><code id='acos.v'>pub fn <a href='#method.acos' class='fnname'>acos</a>(self) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/std/f64.rs.html#631-633' title='goto source code'>[src]</a></h4><div class='docblock'><p>Computes the arccosine of a number. Return value is in radians in
the range [0, pi] or NaN if the number is outside the range
[-1, 1].</p>
<h1 id="examples-27" class="section-header"><a href="#examples-27">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">f64</span>;

<span class="kw">let</span> <span class="ident">f</span> <span class="op">=</span> <span class="ident">f64</span>::<span class="ident">consts</span>::<span class="ident">PI</span> <span class="op">/</span> <span class="number">4.0</span>;

<span class="comment">// acos(cos(pi/4))</span>
<span class="kw">let</span> <span class="ident">abs_difference</span> <span class="op">=</span> (<span class="ident">f</span>.<span class="ident">cos</span>().<span class="ident">acos</span>() <span class="op">-</span> <span class="ident">f64</span>::<span class="ident">consts</span>::<span class="ident">PI</span> <span class="op">/</span> <span class="number">4.0</span>).<span class="ident">abs</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">abs_difference</span> <span class="op">&lt;</span> <span class="number">1e-10</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Af64%3B%0A%0Alet%20f%20%3D%20f64%3A%3Aconsts%3A%3API%20%2F%204.0%3B%0A%0A%2F%2F%20acos(cos(pi%2F4))%0Alet%20abs_difference%20%3D%20(f.cos().acos()%20-%20f64%3A%3Aconsts%3A%3API%20%2F%204.0).abs()%3B%0A%0Aassert!(abs_difference%20%3C%201e-10)%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.atan' class="method"><code id='atan.v'>pub fn <a href='#method.atan' class='fnname'>atan</a>(self) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/std/f64.rs.html#650-652' title='goto source code'>[src]</a></h4><div class='docblock'><p>Computes the arctangent of a number. Return value is in radians in the
range [-pi/2, pi/2];</p>
<h1 id="examples-28" class="section-header"><a href="#examples-28">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">f</span> <span class="op">=</span> <span class="number">1.0_f64</span>;

<span class="comment">// atan(tan(1))</span>
<span class="kw">let</span> <span class="ident">abs_difference</span> <span class="op">=</span> (<span class="ident">f</span>.<span class="ident">tan</span>().<span class="ident">atan</span>() <span class="op">-</span> <span class="number">1.0</span>).<span class="ident">abs</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">abs_difference</span> <span class="op">&lt;</span> <span class="number">1e-10</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Alet%20f%20%3D%201.0_f64%3B%0A%0A%2F%2F%20atan(tan(1))%0Alet%20abs_difference%20%3D%20(f.tan().atan()%20-%201.0).abs()%3B%0A%0Aassert!(abs_difference%20%3C%201e-10)%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.atan2' class="method"><code id='atan2.v'>pub fn <a href='#method.atan2' class='fnname'>atan2</a>(self, other: <a class="primitive" href="primitive.f64.html">f64</a>) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/std/f64.rs.html#685-687' title='goto source code'>[src]</a></h4><div class='docblock'><p>Computes the four quadrant arctangent of <code>self</code> (<code>y</code>) and <code>other</code> (<code>x</code>) in radians.</p>
<ul>
<li><code>x = 0</code>, <code>y = 0</code>: <code>0</code></li>
<li><code>x &gt;= 0</code>: <code>arctan(y/x)</code> -&gt; <code>[-pi/2, pi/2]</code></li>
<li><code>y &gt;= 0</code>: <code>arctan(y/x) + pi</code> -&gt; <code>(pi/2, pi]</code></li>
<li><code>y &lt; 0</code>: <code>arctan(y/x) - pi</code> -&gt; <code>(-pi, -pi/2)</code></li>
</ul>
<h1 id="examples-29" class="section-header"><a href="#examples-29">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">f64</span>;

<span class="kw">let</span> <span class="ident">pi</span> <span class="op">=</span> <span class="ident">f64</span>::<span class="ident">consts</span>::<span class="ident">PI</span>;
<span class="comment">// Positive angles measured counter-clockwise</span>
<span class="comment">// from positive x axis</span>
<span class="comment">// -pi/4 radians (45 deg clockwise)</span>
<span class="kw">let</span> <span class="ident">x1</span> <span class="op">=</span> <span class="number">3.0_f64</span>;
<span class="kw">let</span> <span class="ident">y1</span> <span class="op">=</span> <span class="op">-</span><span class="number">3.0_f64</span>;

<span class="comment">// 3pi/4 radians (135 deg counter-clockwise)</span>
<span class="kw">let</span> <span class="ident">x2</span> <span class="op">=</span> <span class="op">-</span><span class="number">3.0_f64</span>;
<span class="kw">let</span> <span class="ident">y2</span> <span class="op">=</span> <span class="number">3.0_f64</span>;

<span class="kw">let</span> <span class="ident">abs_difference_1</span> <span class="op">=</span> (<span class="ident">y1</span>.<span class="ident">atan2</span>(<span class="ident">x1</span>) <span class="op">-</span> (<span class="op">-</span><span class="ident">pi</span><span class="op">/</span><span class="number">4.0</span>)).<span class="ident">abs</span>();
<span class="kw">let</span> <span class="ident">abs_difference_2</span> <span class="op">=</span> (<span class="ident">y2</span>.<span class="ident">atan2</span>(<span class="ident">x2</span>) <span class="op">-</span> <span class="number">3.0</span><span class="kw-2">*</span><span class="ident">pi</span><span class="op">/</span><span class="number">4.0</span>).<span class="ident">abs</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">abs_difference_1</span> <span class="op">&lt;</span> <span class="number">1e-10</span>);
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">abs_difference_2</span> <span class="op">&lt;</span> <span class="number">1e-10</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Af64%3B%0A%0Alet%20pi%20%3D%20f64%3A%3Aconsts%3A%3API%3B%0A%2F%2F%20Positive%20angles%20measured%20counter-clockwise%0A%2F%2F%20from%20positive%20x%20axis%0A%2F%2F%20-pi%2F4%20radians%20(45%20deg%20clockwise)%0Alet%20x1%20%3D%203.0_f64%3B%0Alet%20y1%20%3D%20-3.0_f64%3B%0A%0A%2F%2F%203pi%2F4%20radians%20(135%20deg%20counter-clockwise)%0Alet%20x2%20%3D%20-3.0_f64%3B%0Alet%20y2%20%3D%203.0_f64%3B%0A%0Alet%20abs_difference_1%20%3D%20(y1.atan2(x1)%20-%20(-pi%2F4.0)).abs()%3B%0Alet%20abs_difference_2%20%3D%20(y2.atan2(x2)%20-%203.0*pi%2F4.0).abs()%3B%0A%0Aassert!(abs_difference_1%20%3C%201e-10)%3B%0Aassert!(abs_difference_2%20%3C%201e-10)%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.sin_cos' class="method"><code id='sin_cos.v'>pub fn <a href='#method.sin_cos' class='fnname'>sin_cos</a>(self) -&gt; <a class="primitive" href="primitive.tuple.html">(</a><a class="primitive" href="primitive.f64.html">f64</a>, <a class="primitive" href="primitive.f64.html">f64</a><a class="primitive" href="primitive.tuple.html">)</a></code><a class='srclink' href='../src/std/f64.rs.html#708-710' title='goto source code'>[src]</a></h4><div class='docblock'><p>Simultaneously computes the sine and cosine of the number, <code>x</code>. Returns
<code>(sin(x), cos(x))</code>.</p>
<h1 id="examples-30" class="section-header"><a href="#examples-30">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">f64</span>;

<span class="kw">let</span> <span class="ident">x</span> <span class="op">=</span> <span class="ident">f64</span>::<span class="ident">consts</span>::<span class="ident">PI</span><span class="op">/</span><span class="number">4.0</span>;
<span class="kw">let</span> <span class="ident">f</span> <span class="op">=</span> <span class="ident">x</span>.<span class="ident">sin_cos</span>();

<span class="kw">let</span> <span class="ident">abs_difference_0</span> <span class="op">=</span> (<span class="ident">f</span>.<span class="number">0</span> <span class="op">-</span> <span class="ident">x</span>.<span class="ident">sin</span>()).<span class="ident">abs</span>();
<span class="kw">let</span> <span class="ident">abs_difference_1</span> <span class="op">=</span> (<span class="ident">f</span>.<span class="number">1</span> <span class="op">-</span> <span class="ident">x</span>.<span class="ident">cos</span>()).<span class="ident">abs</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">abs_difference_0</span> <span class="op">&lt;</span> <span class="number">1e-10</span>);
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">abs_difference_1</span> <span class="op">&lt;</span> <span class="number">1e-10</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Af64%3B%0A%0Alet%20x%20%3D%20f64%3A%3Aconsts%3A%3API%2F4.0%3B%0Alet%20f%20%3D%20x.sin_cos()%3B%0A%0Alet%20abs_difference_0%20%3D%20(f.0%20-%20x.sin()).abs()%3B%0Alet%20abs_difference_1%20%3D%20(f.1%20-%20x.cos()).abs()%3B%0A%0Aassert!(abs_difference_0%20%3C%201e-10)%3B%0Aassert!(abs_difference_1%20%3C%201e-10)%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.exp_m1' class="method"><code id='exp_m1.v'>pub fn <a href='#method.exp_m1' class='fnname'>exp_m1</a>(self) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/std/f64.rs.html#727-729' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns <code>e^(self) - 1</code> in a way that is accurate even if the
number is close to zero.</p>
<h1 id="examples-31" class="section-header"><a href="#examples-31">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">x</span> <span class="op">=</span> <span class="number">7.0_f64</span>;

<span class="comment">// e^(ln(7)) - 1</span>
<span class="kw">let</span> <span class="ident">abs_difference</span> <span class="op">=</span> (<span class="ident">x</span>.<span class="ident">ln</span>().<span class="ident">exp_m1</span>() <span class="op">-</span> <span class="number">6.0</span>).<span class="ident">abs</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">abs_difference</span> <span class="op">&lt;</span> <span class="number">1e-10</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Alet%20x%20%3D%207.0_f64%3B%0A%0A%2F%2F%20e%5E(ln(7))%20-%201%0Alet%20abs_difference%20%3D%20(x.ln().exp_m1()%20-%206.0).abs()%3B%0A%0Aassert!(abs_difference%20%3C%201e-10)%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.ln_1p' class="method"><code id='ln_1p.v'>pub fn <a href='#method.ln_1p' class='fnname'>ln_1p</a>(self) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/std/f64.rs.html#748-750' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns <code>ln(1+n)</code> (natural logarithm) more accurately than if
the operations were performed separately.</p>
<h1 id="examples-32" class="section-header"><a href="#examples-32">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">f64</span>;

<span class="kw">let</span> <span class="ident">x</span> <span class="op">=</span> <span class="ident">f64</span>::<span class="ident">consts</span>::<span class="ident">E</span> <span class="op">-</span> <span class="number">1.0</span>;

<span class="comment">// ln(1 + (e - 1)) == ln(e) == 1</span>
<span class="kw">let</span> <span class="ident">abs_difference</span> <span class="op">=</span> (<span class="ident">x</span>.<span class="ident">ln_1p</span>() <span class="op">-</span> <span class="number">1.0</span>).<span class="ident">abs</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">abs_difference</span> <span class="op">&lt;</span> <span class="number">1e-10</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Af64%3B%0A%0Alet%20x%20%3D%20f64%3A%3Aconsts%3A%3AE%20-%201.0%3B%0A%0A%2F%2F%20ln(1%20%2B%20(e%20-%201))%20%3D%3D%20ln(e)%20%3D%3D%201%0Alet%20abs_difference%20%3D%20(x.ln_1p()%20-%201.0).abs()%3B%0A%0Aassert!(abs_difference%20%3C%201e-10)%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.sinh' class="method"><code id='sinh.v'>pub fn <a href='#method.sinh' class='fnname'>sinh</a>(self) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/std/f64.rs.html#771-773' title='goto source code'>[src]</a></h4><div class='docblock'><p>Hyperbolic sine function.</p>
<h1 id="examples-33" class="section-header"><a href="#examples-33">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">f64</span>;

<span class="kw">let</span> <span class="ident">e</span> <span class="op">=</span> <span class="ident">f64</span>::<span class="ident">consts</span>::<span class="ident">E</span>;
<span class="kw">let</span> <span class="ident">x</span> <span class="op">=</span> <span class="number">1.0_f64</span>;

<span class="kw">let</span> <span class="ident">f</span> <span class="op">=</span> <span class="ident">x</span>.<span class="ident">sinh</span>();
<span class="comment">// Solving sinh() at 1 gives `(e^2-1)/(2e)`</span>
<span class="kw">let</span> <span class="ident">g</span> <span class="op">=</span> (<span class="ident">e</span><span class="kw-2">*</span><span class="ident">e</span> <span class="op">-</span> <span class="number">1.0</span>)<span class="op">/</span>(<span class="number">2.0</span><span class="kw-2">*</span><span class="ident">e</span>);
<span class="kw">let</span> <span class="ident">abs_difference</span> <span class="op">=</span> (<span class="ident">f</span> <span class="op">-</span> <span class="ident">g</span>).<span class="ident">abs</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">abs_difference</span> <span class="op">&lt;</span> <span class="number">1e-10</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Af64%3B%0A%0Alet%20e%20%3D%20f64%3A%3Aconsts%3A%3AE%3B%0Alet%20x%20%3D%201.0_f64%3B%0A%0Alet%20f%20%3D%20x.sinh()%3B%0A%2F%2F%20Solving%20sinh()%20at%201%20gives%20%60(e%5E2-1)%2F(2e)%60%0Alet%20g%20%3D%20(e*e%20-%201.0)%2F(2.0*e)%3B%0Alet%20abs_difference%20%3D%20(f%20-%20g).abs()%3B%0A%0Aassert!(abs_difference%20%3C%201e-10)%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.cosh' class="method"><code id='cosh.v'>pub fn <a href='#method.cosh' class='fnname'>cosh</a>(self) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/std/f64.rs.html#794-796' title='goto source code'>[src]</a></h4><div class='docblock'><p>Hyperbolic cosine function.</p>
<h1 id="examples-34" class="section-header"><a href="#examples-34">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">f64</span>;

<span class="kw">let</span> <span class="ident">e</span> <span class="op">=</span> <span class="ident">f64</span>::<span class="ident">consts</span>::<span class="ident">E</span>;
<span class="kw">let</span> <span class="ident">x</span> <span class="op">=</span> <span class="number">1.0_f64</span>;
<span class="kw">let</span> <span class="ident">f</span> <span class="op">=</span> <span class="ident">x</span>.<span class="ident">cosh</span>();
<span class="comment">// Solving cosh() at 1 gives this result</span>
<span class="kw">let</span> <span class="ident">g</span> <span class="op">=</span> (<span class="ident">e</span><span class="kw-2">*</span><span class="ident">e</span> <span class="op">+</span> <span class="number">1.0</span>)<span class="op">/</span>(<span class="number">2.0</span><span class="kw-2">*</span><span class="ident">e</span>);
<span class="kw">let</span> <span class="ident">abs_difference</span> <span class="op">=</span> (<span class="ident">f</span> <span class="op">-</span> <span class="ident">g</span>).<span class="ident">abs</span>();

<span class="comment">// Same result</span>
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">abs_difference</span> <span class="op">&lt;</span> <span class="number">1.0e-10</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Af64%3B%0A%0Alet%20e%20%3D%20f64%3A%3Aconsts%3A%3AE%3B%0Alet%20x%20%3D%201.0_f64%3B%0Alet%20f%20%3D%20x.cosh()%3B%0A%2F%2F%20Solving%20cosh()%20at%201%20gives%20this%20result%0Alet%20g%20%3D%20(e*e%20%2B%201.0)%2F(2.0*e)%3B%0Alet%20abs_difference%20%3D%20(f%20-%20g).abs()%3B%0A%0A%2F%2F%20Same%20result%0Aassert!(abs_difference%20%3C%201.0e-10)%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.tanh' class="method"><code id='tanh.v'>pub fn <a href='#method.tanh' class='fnname'>tanh</a>(self) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/std/f64.rs.html#817-819' title='goto source code'>[src]</a></h4><div class='docblock'><p>Hyperbolic tangent function.</p>
<h1 id="examples-35" class="section-header"><a href="#examples-35">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">f64</span>;

<span class="kw">let</span> <span class="ident">e</span> <span class="op">=</span> <span class="ident">f64</span>::<span class="ident">consts</span>::<span class="ident">E</span>;
<span class="kw">let</span> <span class="ident">x</span> <span class="op">=</span> <span class="number">1.0_f64</span>;

<span class="kw">let</span> <span class="ident">f</span> <span class="op">=</span> <span class="ident">x</span>.<span class="ident">tanh</span>();
<span class="comment">// Solving tanh() at 1 gives `(1 - e^(-2))/(1 + e^(-2))`</span>
<span class="kw">let</span> <span class="ident">g</span> <span class="op">=</span> (<span class="number">1.0</span> <span class="op">-</span> <span class="ident">e</span>.<span class="ident">powi</span>(<span class="op">-</span><span class="number">2</span>))<span class="op">/</span>(<span class="number">1.0</span> <span class="op">+</span> <span class="ident">e</span>.<span class="ident">powi</span>(<span class="op">-</span><span class="number">2</span>));
<span class="kw">let</span> <span class="ident">abs_difference</span> <span class="op">=</span> (<span class="ident">f</span> <span class="op">-</span> <span class="ident">g</span>).<span class="ident">abs</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">abs_difference</span> <span class="op">&lt;</span> <span class="number">1.0e-10</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Af64%3B%0A%0Alet%20e%20%3D%20f64%3A%3Aconsts%3A%3AE%3B%0Alet%20x%20%3D%201.0_f64%3B%0A%0Alet%20f%20%3D%20x.tanh()%3B%0A%2F%2F%20Solving%20tanh()%20at%201%20gives%20%60(1%20-%20e%5E(-2))%2F(1%20%2B%20e%5E(-2))%60%0Alet%20g%20%3D%20(1.0%20-%20e.powi(-2))%2F(1.0%20%2B%20e.powi(-2))%3B%0Alet%20abs_difference%20%3D%20(f%20-%20g).abs()%3B%0A%0Aassert!(abs_difference%20%3C%201.0e-10)%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.asinh' class="method"><code id='asinh.v'>pub fn <a href='#method.asinh' class='fnname'>asinh</a>(self) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/std/f64.rs.html#835-841' title='goto source code'>[src]</a></h4><div class='docblock'><p>Inverse hyperbolic sine function.</p>
<h1 id="examples-36" class="section-header"><a href="#examples-36">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">x</span> <span class="op">=</span> <span class="number">1.0_f64</span>;
<span class="kw">let</span> <span class="ident">f</span> <span class="op">=</span> <span class="ident">x</span>.<span class="ident">sinh</span>().<span class="ident">asinh</span>();

<span class="kw">let</span> <span class="ident">abs_difference</span> <span class="op">=</span> (<span class="ident">f</span> <span class="op">-</span> <span class="ident">x</span>).<span class="ident">abs</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">abs_difference</span> <span class="op">&lt;</span> <span class="number">1.0e-10</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Alet%20x%20%3D%201.0_f64%3B%0Alet%20f%20%3D%20x.sinh().asinh()%3B%0A%0Alet%20abs_difference%20%3D%20(f%20-%20x).abs()%3B%0A%0Aassert!(abs_difference%20%3C%201.0e-10)%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.acosh' class="method"><code id='acosh.v'>pub fn <a href='#method.acosh' class='fnname'>acosh</a>(self) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/std/f64.rs.html#857-862' title='goto source code'>[src]</a></h4><div class='docblock'><p>Inverse hyperbolic cosine function.</p>
<h1 id="examples-37" class="section-header"><a href="#examples-37">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">x</span> <span class="op">=</span> <span class="number">1.0_f64</span>;
<span class="kw">let</span> <span class="ident">f</span> <span class="op">=</span> <span class="ident">x</span>.<span class="ident">cosh</span>().<span class="ident">acosh</span>();

<span class="kw">let</span> <span class="ident">abs_difference</span> <span class="op">=</span> (<span class="ident">f</span> <span class="op">-</span> <span class="ident">x</span>).<span class="ident">abs</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">abs_difference</span> <span class="op">&lt;</span> <span class="number">1.0e-10</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Alet%20x%20%3D%201.0_f64%3B%0Alet%20f%20%3D%20x.cosh().acosh()%3B%0A%0Alet%20abs_difference%20%3D%20(f%20-%20x).abs()%3B%0A%0Aassert!(abs_difference%20%3C%201.0e-10)%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.atanh' class="method"><code id='atanh.v'>pub fn <a href='#method.atanh' class='fnname'>atanh</a>(self) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/std/f64.rs.html#880-882' title='goto source code'>[src]</a></h4><div class='docblock'><p>Inverse hyperbolic tangent function.</p>
<h1 id="examples-38" class="section-header"><a href="#examples-38">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">f64</span>;

<span class="kw">let</span> <span class="ident">e</span> <span class="op">=</span> <span class="ident">f64</span>::<span class="ident">consts</span>::<span class="ident">E</span>;
<span class="kw">let</span> <span class="ident">f</span> <span class="op">=</span> <span class="ident">e</span>.<span class="ident">tanh</span>().<span class="ident">atanh</span>();

<span class="kw">let</span> <span class="ident">abs_difference</span> <span class="op">=</span> (<span class="ident">f</span> <span class="op">-</span> <span class="ident">e</span>).<span class="ident">abs</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">abs_difference</span> <span class="op">&lt;</span> <span class="number">1.0e-10</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Af64%3B%0A%0Alet%20e%20%3D%20f64%3A%3Aconsts%3A%3AE%3B%0Alet%20f%20%3D%20e.tanh().atanh()%3B%0A%0Alet%20abs_difference%20%3D%20(f%20-%20e).abs()%3B%0A%0Aassert!(abs_difference%20%3C%201.0e-10)%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.clamp' class="method"><code id='clamp.v'>pub fn <a href='#method.clamp' class='fnname'>clamp</a>(self, min: <a class="primitive" href="primitive.f64.html">f64</a>, max: <a class="primitive" href="primitive.f64.html">f64</a>) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/std/f64.rs.html#907-913' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>clamp</code>&nbsp;<a href="https://github.com/rust-lang/rust/issues/44095">#44095</a>)</div></div><div class='docblock'><p>Restrict a value to a certain interval unless it is NaN.</p>
<p>Returns <code>max</code> if <code>self</code> is greater than <code>max</code>, and <code>min</code> if <code>self</code> is
less than <code>min</code>. Otherwise this returns <code>self</code>.</p>
<p>Not that this function returns NaN if the initial value was NaN as
well.</p>
<h1 id="panics" class="section-header"><a href="#panics">Panics</a></h1>
<p>Panics if <code>min &gt; max</code>, <code>min</code> is NaN, or <code>max</code> is NaN.</p>
<h1 id="examples-39" class="section-header"><a href="#examples-39">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="attribute">#![<span class="ident">feature</span>(<span class="ident">clamp</span>)]</span>
<span class="macro">assert</span><span class="macro">!</span>((<span class="op">-</span><span class="number">3.0f64</span>).<span class="ident">clamp</span>(<span class="op">-</span><span class="number">2.0</span>, <span class="number">1.0</span>) <span class="op">==</span> <span class="op">-</span><span class="number">2.0</span>);
<span class="macro">assert</span><span class="macro">!</span>((<span class="number">0.0f64</span>).<span class="ident">clamp</span>(<span class="op">-</span><span class="number">2.0</span>, <span class="number">1.0</span>) <span class="op">==</span> <span class="number">0.0</span>);
<span class="macro">assert</span><span class="macro">!</span>((<span class="number">2.0f64</span>).<span class="ident">clamp</span>(<span class="op">-</span><span class="number">2.0</span>, <span class="number">1.0</span>) <span class="op">==</span> <span class="number">1.0</span>);
<span class="macro">assert</span><span class="macro">!</span>((<span class="ident">std</span>::<span class="ident">f64</span>::<span class="ident">NAN</span>).<span class="ident">clamp</span>(<span class="op">-</span><span class="number">2.0</span>, <span class="number">1.0</span>).<span class="ident">is_nan</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0A%23!%5Bfeature(clamp)%5D%0Afn%20main()%20%7B%0Aassert!((-3.0f64).clamp(-2.0%2C%201.0)%20%3D%3D%20-2.0)%3B%0Aassert!((0.0f64).clamp(-2.0%2C%201.0)%20%3D%3D%200.0)%3B%0Aassert!((2.0f64).clamp(-2.0%2C%201.0)%20%3D%3D%201.0)%3B%0Aassert!((std%3A%3Af64%3A%3ANAN).clamp(-2.0%2C%201.0).is_nan())%3B%0A%7D&amp;version=nightly">Run</a></pre></div>
</div></div><h3 id='impl-1' class='impl'><code class='in-band'>impl <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-1' class='anchor'></a><a class='srclink' href='../src/core/num/f64.rs.html#146-490' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.is_nan' class="method"><code id='is_nan.v'>pub fn <a href='#method.is_nan' class='fnname'>is_nan</a>(self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code><a class='srclink' href='../src/core/num/f64.rs.html#160-162' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns <code>true</code> if this value is <code>NaN</code>.</p>

<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">f64</span>;

<span class="kw">let</span> <span class="ident">nan</span> <span class="op">=</span> <span class="ident">f64</span>::<span class="ident">NAN</span>;
<span class="kw">let</span> <span class="ident">f</span> <span class="op">=</span> <span class="number">7.0_f64</span>;

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">nan</span>.<span class="ident">is_nan</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">f</span>.<span class="ident">is_nan</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Af64%3B%0A%0Alet%20nan%20%3D%20f64%3A%3ANAN%3B%0Alet%20f%20%3D%207.0_f64%3B%0A%0Aassert!(nan.is_nan())%3B%0Aassert!(!f.is_nan())%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.is_infinite' class="method"><code id='is_infinite.v'>pub fn <a href='#method.is_infinite' class='fnname'>is_infinite</a>(self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code><a class='srclink' href='../src/core/num/f64.rs.html#191-193' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns <code>true</code> if this value is positive infinity or negative infinity, and
<code>false</code> otherwise.</p>

<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">f64</span>;

<span class="kw">let</span> <span class="ident">f</span> <span class="op">=</span> <span class="number">7.0f64</span>;
<span class="kw">let</span> <span class="ident">inf</span> <span class="op">=</span> <span class="ident">f64</span>::<span class="ident">INFINITY</span>;
<span class="kw">let</span> <span class="ident">neg_inf</span> <span class="op">=</span> <span class="ident">f64</span>::<span class="ident">NEG_INFINITY</span>;
<span class="kw">let</span> <span class="ident">nan</span> <span class="op">=</span> <span class="ident">f64</span>::<span class="ident">NAN</span>;

<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">f</span>.<span class="ident">is_infinite</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">nan</span>.<span class="ident">is_infinite</span>());

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">inf</span>.<span class="ident">is_infinite</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">neg_inf</span>.<span class="ident">is_infinite</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Af64%3B%0A%0Alet%20f%20%3D%207.0f64%3B%0Alet%20inf%20%3D%20f64%3A%3AINFINITY%3B%0Alet%20neg_inf%20%3D%20f64%3A%3ANEG_INFINITY%3B%0Alet%20nan%20%3D%20f64%3A%3ANAN%3B%0A%0Aassert!(!f.is_infinite())%3B%0Aassert!(!nan.is_infinite())%3B%0A%0Aassert!(inf.is_infinite())%3B%0Aassert!(neg_inf.is_infinite())%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.is_finite' class="method"><code id='is_finite.v'>pub fn <a href='#method.is_finite' class='fnname'>is_finite</a>(self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code><a class='srclink' href='../src/core/num/f64.rs.html#213-217' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns <code>true</code> if this number is neither infinite nor <code>NaN</code>.</p>

<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">f64</span>;

<span class="kw">let</span> <span class="ident">f</span> <span class="op">=</span> <span class="number">7.0f64</span>;
<span class="kw">let</span> <span class="ident">inf</span>: <span class="ident">f64</span> <span class="op">=</span> <span class="ident">f64</span>::<span class="ident">INFINITY</span>;
<span class="kw">let</span> <span class="ident">neg_inf</span>: <span class="ident">f64</span> <span class="op">=</span> <span class="ident">f64</span>::<span class="ident">NEG_INFINITY</span>;
<span class="kw">let</span> <span class="ident">nan</span>: <span class="ident">f64</span> <span class="op">=</span> <span class="ident">f64</span>::<span class="ident">NAN</span>;

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">f</span>.<span class="ident">is_finite</span>());

<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">nan</span>.<span class="ident">is_finite</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">inf</span>.<span class="ident">is_finite</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">neg_inf</span>.<span class="ident">is_finite</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Af64%3B%0A%0Alet%20f%20%3D%207.0f64%3B%0Alet%20inf%3A%20f64%20%3D%20f64%3A%3AINFINITY%3B%0Alet%20neg_inf%3A%20f64%20%3D%20f64%3A%3ANEG_INFINITY%3B%0Alet%20nan%3A%20f64%20%3D%20f64%3A%3ANAN%3B%0A%0Aassert!(f.is_finite())%3B%0A%0Aassert!(!nan.is_finite())%3B%0Aassert!(!inf.is_finite())%3B%0Aassert!(!neg_inf.is_finite())%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.is_normal' class="method"><code id='is_normal.v'>pub fn <a href='#method.is_normal' class='fnname'>is_normal</a>(self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code><a class='srclink' href='../src/core/num/f64.rs.html#242-244' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns <code>true</code> if the number is neither zero, infinite,
<a href="https://en.wikipedia.org/wiki/Denormal_number">subnormal</a>, or <code>NaN</code>.</p>

<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">f64</span>;

<span class="kw">let</span> <span class="ident">min</span> <span class="op">=</span> <span class="ident">f64</span>::<span class="ident">MIN_POSITIVE</span>; <span class="comment">// 2.2250738585072014e-308f64</span>
<span class="kw">let</span> <span class="ident">max</span> <span class="op">=</span> <span class="ident">f64</span>::<span class="ident">MAX</span>;
<span class="kw">let</span> <span class="ident">lower_than_min</span> <span class="op">=</span> <span class="number">1.0e-308_f64</span>;
<span class="kw">let</span> <span class="ident">zero</span> <span class="op">=</span> <span class="number">0.0f64</span>;

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">min</span>.<span class="ident">is_normal</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">max</span>.<span class="ident">is_normal</span>());

<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">zero</span>.<span class="ident">is_normal</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">f64</span>::<span class="ident">NAN</span>.<span class="ident">is_normal</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">f64</span>::<span class="ident">INFINITY</span>.<span class="ident">is_normal</span>());
<span class="comment">// Values between `0` and `min` are Subnormal.</span>
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">lower_than_min</span>.<span class="ident">is_normal</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Af64%3B%0A%0Alet%20min%20%3D%20f64%3A%3AMIN_POSITIVE%3B%20%2F%2F%202.2250738585072014e-308f64%0Alet%20max%20%3D%20f64%3A%3AMAX%3B%0Alet%20lower_than_min%20%3D%201.0e-308_f64%3B%0Alet%20zero%20%3D%200.0f64%3B%0A%0Aassert!(min.is_normal())%3B%0Aassert!(max.is_normal())%3B%0A%0Aassert!(!zero.is_normal())%3B%0Aassert!(!f64%3A%3ANAN.is_normal())%3B%0Aassert!(!f64%3A%3AINFINITY.is_normal())%3B%0A%2F%2F%20Values%20between%20%600%60%20and%20%60min%60%20are%20Subnormal.%0Aassert!(!lower_than_min.is_normal())%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.classify' class="method"><code id='classify.v'>pub fn <a href='#method.classify' class='fnname'>classify</a>(self) -&gt; <a class="enum" href="../std/num/enum.FpCategory.html" title="enum std::num::FpCategory">FpCategory</a></code><a class='srclink' href='../src/core/num/f64.rs.html#261-273' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the floating point category of the number. If only one property
is going to be tested, it is generally faster to use the specific
predicate instead.</p>

<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">num</span>::<span class="ident">FpCategory</span>;
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">f64</span>;

<span class="kw">let</span> <span class="ident">num</span> <span class="op">=</span> <span class="number">12.4_f64</span>;
<span class="kw">let</span> <span class="ident">inf</span> <span class="op">=</span> <span class="ident">f64</span>::<span class="ident">INFINITY</span>;

<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">num</span>.<span class="ident">classify</span>(), <span class="ident">FpCategory</span>::<span class="ident">Normal</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">inf</span>.<span class="ident">classify</span>(), <span class="ident">FpCategory</span>::<span class="ident">Infinite</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Anum%3A%3AFpCategory%3B%0Ause%20std%3A%3Af64%3B%0A%0Alet%20num%20%3D%2012.4_f64%3B%0Alet%20inf%20%3D%20f64%3A%3AINFINITY%3B%0A%0Aassert_eq!(num.classify()%2C%20FpCategory%3A%3ANormal)%3B%0Aassert_eq!(inf.classify()%2C%20FpCategory%3A%3AInfinite)%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.is_sign_positive' class="method"><code id='is_sign_positive.v'>pub fn <a href='#method.is_sign_positive' class='fnname'>is_sign_positive</a>(self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code><a class='srclink' href='../src/core/num/f64.rs.html#287-289' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns <code>true</code> if <code>self</code> has a positive sign, including <code>+0.0</code>, <code>NaN</code>s with
positive sign bit and positive infinity.</p>

<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">f</span> <span class="op">=</span> <span class="number">7.0_f64</span>;
<span class="kw">let</span> <span class="ident">g</span> <span class="op">=</span> <span class="op">-</span><span class="number">7.0_f64</span>;

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">f</span>.<span class="ident">is_sign_positive</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">g</span>.<span class="ident">is_sign_positive</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Alet%20f%20%3D%207.0_f64%3B%0Alet%20g%20%3D%20-7.0_f64%3B%0A%0Aassert!(f.is_sign_positive())%3B%0Aassert!(!g.is_sign_positive())%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.is_sign_negative' class="method"><code id='is_sign_negative.v'>pub fn <a href='#method.is_sign_negative' class='fnname'>is_sign_negative</a>(self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code><a class='srclink' href='../src/core/num/f64.rs.html#311-313' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns <code>true</code> if <code>self</code> has a negative sign, including <code>-0.0</code>, <code>NaN</code>s with
negative sign bit and negative infinity.</p>

<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">f</span> <span class="op">=</span> <span class="number">7.0_f64</span>;
<span class="kw">let</span> <span class="ident">g</span> <span class="op">=</span> <span class="op">-</span><span class="number">7.0_f64</span>;

<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">f</span>.<span class="ident">is_sign_negative</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">g</span>.<span class="ident">is_sign_negative</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Alet%20f%20%3D%207.0_f64%3B%0Alet%20g%20%3D%20-7.0_f64%3B%0A%0Aassert!(!f.is_sign_negative())%3B%0Aassert!(g.is_sign_negative())%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.recip' class="method"><code id='recip.v'>pub fn <a href='#method.recip' class='fnname'>recip</a>(self) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/core/num/f64.rs.html#333-335' title='goto source code'>[src]</a></h4><div class='docblock'><p>Takes the reciprocal (inverse) of a number, <code>1/x</code>.</p>

<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">x</span> <span class="op">=</span> <span class="number">2.0_f64</span>;
<span class="kw">let</span> <span class="ident">abs_difference</span> <span class="op">=</span> (<span class="ident">x</span>.<span class="ident">recip</span>() <span class="op">-</span> (<span class="number">1.0</span><span class="op">/</span><span class="ident">x</span>)).<span class="ident">abs</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">abs_difference</span> <span class="op">&lt;</span> <span class="number">1e-10</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Alet%20x%20%3D%202.0_f64%3B%0Alet%20abs_difference%20%3D%20(x.recip()%20-%20(1.0%2Fx)).abs()%3B%0A%0Aassert!(abs_difference%20%3C%201e-10)%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.to_degrees' class="method"><code id='to_degrees.v'>pub fn <a href='#method.to_degrees' class='fnname'>to_degrees</a>(self) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/core/num/f64.rs.html#350-355' title='goto source code'>[src]</a></h4><div class='docblock'><p>Converts radians to degrees.</p>

<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">f64</span>::<span class="ident">consts</span>;

<span class="kw">let</span> <span class="ident">angle</span> <span class="op">=</span> <span class="ident">consts</span>::<span class="ident">PI</span>;

<span class="kw">let</span> <span class="ident">abs_difference</span> <span class="op">=</span> (<span class="ident">angle</span>.<span class="ident">to_degrees</span>() <span class="op">-</span> <span class="number">180.0</span>).<span class="ident">abs</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">abs_difference</span> <span class="op">&lt;</span> <span class="number">1e-10</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Af64%3A%3Aconsts%3B%0A%0Alet%20angle%20%3D%20consts%3A%3API%3B%0A%0Alet%20abs_difference%20%3D%20(angle.to_degrees()%20-%20180.0).abs()%3B%0A%0Aassert!(abs_difference%20%3C%201e-10)%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.to_radians' class="method"><code id='to_radians.v'>pub fn <a href='#method.to_radians' class='fnname'>to_radians</a>(self) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/core/num/f64.rs.html#370-373' title='goto source code'>[src]</a></h4><div class='docblock'><p>Converts degrees to radians.</p>

<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">f64</span>::<span class="ident">consts</span>;

<span class="kw">let</span> <span class="ident">angle</span> <span class="op">=</span> <span class="number">180.0_f64</span>;

<span class="kw">let</span> <span class="ident">abs_difference</span> <span class="op">=</span> (<span class="ident">angle</span>.<span class="ident">to_radians</span>() <span class="op">-</span> <span class="ident">consts</span>::<span class="ident">PI</span>).<span class="ident">abs</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">abs_difference</span> <span class="op">&lt;</span> <span class="number">1e-10</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Af64%3A%3Aconsts%3B%0A%0Alet%20angle%20%3D%20180.0_f64%3B%0A%0Alet%20abs_difference%20%3D%20(angle.to_radians()%20-%20consts%3A%3API).abs()%3B%0A%0Aassert!(abs_difference%20%3C%201e-10)%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.max' class="method"><code id='max.v'>pub fn <a href='#method.max' class='fnname'>max</a>(self, other: <a class="primitive" href="primitive.f64.html">f64</a>) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/core/num/f64.rs.html#387-397' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the maximum of the two numbers.</p>

<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">x</span> <span class="op">=</span> <span class="number">1.0_f64</span>;
<span class="kw">let</span> <span class="ident">y</span> <span class="op">=</span> <span class="number">2.0_f64</span>;

<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">x</span>.<span class="ident">max</span>(<span class="ident">y</span>), <span class="ident">y</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Alet%20x%20%3D%201.0_f64%3B%0Alet%20y%20%3D%202.0_f64%3B%0A%0Aassert_eq!(x.max(y)%2C%20y)%3B%0A%7D">Run</a></pre></div>
<p>If one of the arguments is NaN, then the other argument is returned.</p>
</div><h4 id='method.min' class="method"><code id='min.v'>pub fn <a href='#method.min' class='fnname'>min</a>(self, other: <a class="primitive" href="primitive.f64.html">f64</a>) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/core/num/f64.rs.html#411-421' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the minimum of the two numbers.</p>

<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">x</span> <span class="op">=</span> <span class="number">1.0_f64</span>;
<span class="kw">let</span> <span class="ident">y</span> <span class="op">=</span> <span class="number">2.0_f64</span>;

<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">x</span>.<span class="ident">min</span>(<span class="ident">y</span>), <span class="ident">x</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Alet%20x%20%3D%201.0_f64%3B%0Alet%20y%20%3D%202.0_f64%3B%0A%0Aassert_eq!(x.min(y)%2C%20x)%3B%0A%7D">Run</a></pre></div>
<p>If one of the arguments is NaN, then the other argument is returned.</p>
</div><h4 id='method.to_bits' class="method"><code id='to_bits.v'>pub fn <a href='#method.to_bits' class='fnname'>to_bits</a>(self) -&gt; <a class="primitive" href="primitive.u64.html">u64</a></code><div class='since' title='Stable since Rust version 1.20.0'>1.20.0</div><a class='srclink' href='../src/core/num/f64.rs.html#442-444' title='goto source code'>[src]</a></h4><div class='docblock'><p>Raw transmutation to <code>u64</code>.</p>
<p>This is currently identical to <code>transmute::&lt;f64, u64&gt;(self)</code> on all platforms.</p>
<p>See <code>from_bits</code> for some discussion of the portability of this operation
(there are almost no issues).</p>
<p>Note that this function is distinct from <code>as</code> casting, which attempts to
preserve the <em>numeric</em> value, and not the bitwise value.</p>
<h1 id="examples-40" class="section-header"><a href="#examples-40">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="macro">assert</span><span class="macro">!</span>((<span class="number">1f64</span>).<span class="ident">to_bits</span>() <span class="op">!=</span> <span class="number">1f64</span> <span class="kw">as</span> <span class="ident">u64</span>); <span class="comment">// to_bits() is not casting!</span>
<span class="macro">assert_eq</span><span class="macro">!</span>((<span class="number">12.5f64</span>).<span class="ident">to_bits</span>(), <span class="number">0x4029000000000000</span>);
<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Aassert!((1f64).to_bits()%20!%3D%201f64%20as%20u64)%3B%20%2F%2F%20to_bits()%20is%20not%20casting!%0Aassert_eq!((12.5f64).to_bits()%2C%200x4029000000000000)%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.from_bits' class="method"><code id='from_bits.v'>pub fn <a href='#method.from_bits' class='fnname'>from_bits</a>(v: <a class="primitive" href="primitive.u64.html">u64</a>) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><div class='since' title='Stable since Rust version 1.20.0'>1.20.0</div><a class='srclink' href='../src/core/num/f64.rs.html#486-489' title='goto source code'>[src]</a></h4><div class='docblock'><p>Raw transmutation from <code>u64</code>.</p>
<p>This is currently identical to <code>transmute::&lt;u64, f64&gt;(v)</code> on all platforms.
It turns out this is incredibly portable, for two reasons:</p>
<ul>
<li>Floats and Ints have the same endianness on all supported platforms.</li>
<li>IEEE-754 very precisely specifies the bit layout of floats.</li>
</ul>
<p>However there is one caveat: prior to the 2008 version of IEEE-754, how
to interpret the NaN signaling bit wasn't actually specified. Most platforms
(notably x86 and ARM) picked the interpretation that was ultimately
standardized in 2008, but some didn't (notably MIPS). As a result, all
signaling NaNs on MIPS are quiet NaNs on x86, and vice-versa.</p>
<p>Rather than trying to preserve signaling-ness cross-platform, this
implementation favours preserving the exact bits. This means that
any payloads encoded in NaNs will be preserved even if the result of
this method is sent over the network from an x86 machine to a MIPS one.</p>
<p>If the results of this method are only manipulated by the same
architecture that produced them, then there is no portability concern.</p>
<p>If the input isn't NaN, then there is no portability concern.</p>
<p>If you don't care about signalingness (very likely), then there is no
portability concern.</p>
<p>Note that this function is distinct from <code>as</code> casting, which attempts to
preserve the <em>numeric</em> value, and not the bitwise value.</p>
<h1 id="examples-41" class="section-header"><a href="#examples-41">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">f64</span>;
<span class="kw">let</span> <span class="ident">v</span> <span class="op">=</span> <span class="ident">f64</span>::<span class="ident">from_bits</span>(<span class="number">0x4029000000000000</span>);
<span class="kw">let</span> <span class="ident">difference</span> <span class="op">=</span> (<span class="ident">v</span> <span class="op">-</span> <span class="number">12.5</span>).<span class="ident">abs</span>();
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">difference</span> <span class="op">&lt;=</span> <span class="number">1e-5</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Af64%3B%0Alet%20v%20%3D%20f64%3A%3Afrom_bits(0x4029000000000000)%3B%0Alet%20difference%20%3D%20(v%20-%2012.5).abs()%3B%0Aassert!(difference%20%3C%3D%201e-5)%3B%0A%7D">Run</a></pre></div>
</div></div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-FromStr' class='impl'><code class='in-band'>impl <a class="trait" href="../std/str/trait.FromStr.html" title="trait std::str::FromStr">FromStr</a> for <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-FromStr' class='anchor'></a><a class='srclink' href='../src/core/num/dec2flt/mod.rs.html#102-157' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Err' class="type"><code id='Err.t'>type <a href='../std/str/trait.FromStr.html#associatedtype.Err' class="type">Err</a> = <a class="struct" href="../std/num/struct.ParseFloatError.html" title="struct std::num::ParseFloatError">ParseFloatError</a></code></h4><div class='docblock'><p>The associated error which can be returned from parsing.</p>
</div><h4 id='method.from_str' class="method"><code id='from_str.v'>fn <a href='../std/str/trait.FromStr.html#tymethod.from_str' class='fnname'>from_str</a>(src: &amp;<a class="primitive" href="primitive.str.html">str</a>) -&gt; <a class="enum" href="../std/result/enum.Result.html" title="enum std::result::Result">Result</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>, <a class="struct" href="../std/num/struct.ParseFloatError.html" title="struct std::num::ParseFloatError">ParseFloatError</a>&gt;</code><a class='srclink' href='../src/core/num/dec2flt/mod.rs.html#154-156' title='goto source code'>[src]</a></h4><div class='docblock'><p>Converts a string in base 10 to a float.
Accepts an optional decimal exponent.</p>
<p>This function accepts strings such as</p>
<ul>
<li>'3.14'</li>
<li>'-3.14'</li>
<li>'2.5E10', or equivalently, '2.5e10'</li>
<li>'2.5E-10'</li>
<li>'5.'</li>
<li>'.5', or, equivalently, '0.5'</li>
<li>'inf', '-inf', 'NaN'</li>
</ul>
<p>Leading and trailing whitespace represent an error.</p>
<h1 id="grammar" class="section-header"><a href="#grammar">Grammar</a></h1>
<p>All strings that adhere to the following <a href="https://www.w3.org/TR/REC-xml/#sec-notation">EBNF</a> grammar
will result in an <a href="../std/result/enum.Result.html#Ok.v" title="`Ok`"><code>Ok</code></a> being returned:</p>
<pre><code class="language-txt">Float  ::= Sign? ( 'inf' | 'NaN' | Number )
Number ::= ( Digit+ |
             Digit+ '.' Digit* |
             Digit* '.' Digit+ ) Exp?
Exp    ::= [eE] Sign? Digit+
Sign   ::= [+-]
Digit  ::= [0-9]
</code></pre>
<h1 id="known-bugs" class="section-header"><a href="#known-bugs">Known bugs</a></h1>
<p>In some situations, some strings that should create a valid float
instead return an error. See <a href="https://github.com/rust-lang/rust/issues/31407">issue #31407</a> for details.</p>
<h1 id="arguments" class="section-header"><a href="#arguments">Arguments</a></h1>
<ul>
<li>src - A string</li>
</ul>
<h1 id="return-value" class="section-header"><a href="#return-value">Return value</a></h1>
<p><code>Err(ParseFloatError)</code> if the string did not represent a valid
number. Otherwise, <code>Ok(n)</code> where <code>n</code> is the floating-point
number represented by <code>src</code>.</p>
</div></div><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="../std/clone/trait.Clone.html" title="trait std::clone::Clone">Clone</a> for <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../src/core/clone.rs.html#165-170' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>fn <a href='../std/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&amp;self) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/core/clone.rs.html#167-169' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="../std/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div><h4 id='method.clone_from' class="method"><code id='clone_from.v'>fn <a href='../std/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&amp;mut self, source: <a class="primitive" href="primitive.reference.html">&amp;</a>Self)</code><a class='srclink' href='../src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="../std/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></div><h3 id='impl-LowerExp' class='impl'><code class='in-band'>impl <a class="trait" href="../std/fmt/trait.LowerExp.html" title="trait std::fmt::LowerExp">LowerExp</a> for <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-LowerExp' class='anchor'></a><a class='srclink' href='../src/core/fmt/float.rs.html#139-143' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='../std/fmt/trait.LowerExp.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, fmt: &amp;mut <a class="struct" href="../std/fmt/struct.Formatter.html" title="struct std::fmt::Formatter">Formatter</a>) -&gt; <a class="enum" href="../std/result/enum.Result.html" title="enum std::result::Result">Result</a>&lt;<a class="primitive" href="primitive.unit.html">()</a>, <a class="struct" href="../std/fmt/struct.Error.html" title="struct std::fmt::Error">Error</a>&gt;</code><a class='srclink' href='../src/core/fmt/float.rs.html#140-142' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter.</p>
</div></div><h3 id='impl-Sum%3Cf64%3E' class='impl'><code class='in-band'>impl <a class="trait" href="../std/iter/trait.Sum.html" title="trait std::iter::Sum">Sum</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt; for <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-Sum%3Cf64%3E' class='anchor'></a><div class='since' title='Stable since Rust version 1.12.0'>1.12.0</div><a class='srclink' href='../src/core/iter/traits/accum.rs.html#85-89' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.sum' class="method hidden"><code id='sum.v'>fn <a href='../std/iter/trait.Sum.html#tymethod.sum' class='fnname'>sum</a>&lt;I&gt;(iter: I) -&gt; <a class="primitive" href="primitive.f64.html">f64</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;I: <a class="trait" href="../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a>&lt;Item = <a class="primitive" href="primitive.f64.html">f64</a>&gt;,&nbsp;</span></code><a class='srclink' href='../src/core/iter/traits/accum.rs.html#86-88' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Method which takes an iterator and generates <code>Self</code> from the elements by &quot;summing up&quot; the items. <a href="../std/iter/trait.Sum.html#tymethod.sum">Read more</a></p>
</div></div><h3 id='impl-Sum%3C%26%27a%20f64%3E' class='impl'><code class='in-band'>impl&lt;'a&gt; <a class="trait" href="../std/iter/trait.Sum.html" title="trait std::iter::Sum">Sum</a>&lt;&amp;'a <a class="primitive" href="primitive.f64.html">f64</a>&gt; for <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-Sum%3C%26%27a%20f64%3E' class='anchor'></a><div class='since' title='Stable since Rust version 1.12.0'>1.12.0</div><a class='srclink' href='../src/core/iter/traits/accum.rs.html#99-103' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.sum-1' class="method hidden"><code id='sum.v-1'>fn <a href='../std/iter/trait.Sum.html#tymethod.sum' class='fnname'>sum</a>&lt;I&gt;(iter: I) -&gt; <a class="primitive" href="primitive.f64.html">f64</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;I: <a class="trait" href="../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a>&lt;Item = &amp;'a <a class="primitive" href="primitive.f64.html">f64</a>&gt;,&nbsp;</span></code><a class='srclink' href='../src/core/iter/traits/accum.rs.html#100-102' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Method which takes an iterator and generates <code>Self</code> from the elements by &quot;summing up&quot; the items. <a href="../std/iter/trait.Sum.html#tymethod.sum">Read more</a></p>
</div></div><h3 id='impl-Sub%3C%26%27_%20f64%3E' class='impl'><code class='in-band'>impl&lt;'_&gt; <a class="trait" href="../std/ops/trait.Sub.html" title="trait std::ops::Sub">Sub</a>&lt;&amp;'_ <a class="primitive" href="primitive.f64.html">f64</a>&gt; for <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-Sub%3C%26%27_%20f64%3E' class='anchor'></a><a class='srclink' href='../src/core/internal_macros.rs.html#40-47' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Output' class="type"><code id='Output.t'>type <a href='../std/ops/trait.Sub.html#associatedtype.Output' class="type">Output</a> = &lt;<a class="primitive" href="primitive.f64.html">f64</a> as <a class="trait" href="../std/ops/trait.Sub.html" title="trait std::ops::Sub">Sub</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt;&gt;::<a class="type" href="../std/ops/trait.Sub.html#associatedtype.Output" title="type std::ops::Sub::Output">Output</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>-</code> operator.</p>
</div><h4 id='method.sub' class="method hidden"><code id='sub.v'>fn <a href='../std/ops/trait.Sub.html#tymethod.sub' class='fnname'>sub</a>(self, other: &amp;<a class="primitive" href="primitive.f64.html">f64</a>) -&gt; &lt;<a class="primitive" href="primitive.f64.html">f64</a> as <a class="trait" href="../std/ops/trait.Sub.html" title="trait std::ops::Sub">Sub</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt;&gt;::<a class="type" href="../std/ops/trait.Sub.html#associatedtype.Output" title="type std::ops::Sub::Output">Output</a></code><a class='srclink' href='../src/core/internal_macros.rs.html#44-46' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the <code>-</code> operation.</p>
</div></div><h3 id='impl-Sub%3Cf64%3E' class='impl'><code class='in-band'>impl <a class="trait" href="../std/ops/trait.Sub.html" title="trait std::ops::Sub">Sub</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt; for <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-Sub%3Cf64%3E' class='anchor'></a><a class='srclink' href='../src/core/ops/arith.rs.html#193-199' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Output-1' class="type"><code id='Output.t-1'>type <a href='../std/ops/trait.Sub.html#associatedtype.Output' class="type">Output</a> = <a class="primitive" href="primitive.f64.html">f64</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>-</code> operator.</p>
</div><h4 id='method.sub-1' class="method hidden"><code id='sub.v-1'>fn <a href='../std/ops/trait.Sub.html#tymethod.sub' class='fnname'>sub</a>(self, other: <a class="primitive" href="primitive.f64.html">f64</a>) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/core/ops/arith.rs.html#198' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the <code>-</code> operation.</p>
</div></div><h3 id='impl-Sub%3Cf64%3E-1' class='impl'><code class='in-band'>impl&lt;'a&gt; <a class="trait" href="../std/ops/trait.Sub.html" title="trait std::ops::Sub">Sub</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt; for &amp;'a <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-Sub%3Cf64%3E-1' class='anchor'></a><a class='srclink' href='../src/core/internal_macros.rs.html#30-37' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Output-2' class="type"><code id='Output.t-2'>type <a href='../std/ops/trait.Sub.html#associatedtype.Output' class="type">Output</a> = &lt;<a class="primitive" href="primitive.f64.html">f64</a> as <a class="trait" href="../std/ops/trait.Sub.html" title="trait std::ops::Sub">Sub</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt;&gt;::<a class="type" href="../std/ops/trait.Sub.html#associatedtype.Output" title="type std::ops::Sub::Output">Output</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>-</code> operator.</p>
</div><h4 id='method.sub-2' class="method hidden"><code id='sub.v-2'>fn <a href='../std/ops/trait.Sub.html#tymethod.sub' class='fnname'>sub</a>(self, other: <a class="primitive" href="primitive.f64.html">f64</a>) -&gt; &lt;<a class="primitive" href="primitive.f64.html">f64</a> as <a class="trait" href="../std/ops/trait.Sub.html" title="trait std::ops::Sub">Sub</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt;&gt;::<a class="type" href="../std/ops/trait.Sub.html#associatedtype.Output" title="type std::ops::Sub::Output">Output</a></code><a class='srclink' href='../src/core/internal_macros.rs.html#34-36' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the <code>-</code> operation.</p>
</div></div><h3 id='impl-Sub%3C%26%27_%20f64%3E-1' class='impl'><code class='in-band'>impl&lt;'_, '_&gt; <a class="trait" href="../std/ops/trait.Sub.html" title="trait std::ops::Sub">Sub</a>&lt;&amp;'_ <a class="primitive" href="primitive.f64.html">f64</a>&gt; for &amp;'_ <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-Sub%3C%26%27_%20f64%3E-1' class='anchor'></a><a class='srclink' href='../src/core/internal_macros.rs.html#50-57' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Output-3' class="type"><code id='Output.t-3'>type <a href='../std/ops/trait.Sub.html#associatedtype.Output' class="type">Output</a> = &lt;<a class="primitive" href="primitive.f64.html">f64</a> as <a class="trait" href="../std/ops/trait.Sub.html" title="trait std::ops::Sub">Sub</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt;&gt;::<a class="type" href="../std/ops/trait.Sub.html#associatedtype.Output" title="type std::ops::Sub::Output">Output</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>-</code> operator.</p>
</div><h4 id='method.sub-3' class="method hidden"><code id='sub.v-3'>fn <a href='../std/ops/trait.Sub.html#tymethod.sub' class='fnname'>sub</a>(self, other: &amp;<a class="primitive" href="primitive.f64.html">f64</a>) -&gt; &lt;<a class="primitive" href="primitive.f64.html">f64</a> as <a class="trait" href="../std/ops/trait.Sub.html" title="trait std::ops::Sub">Sub</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt;&gt;::<a class="type" href="../std/ops/trait.Sub.html#associatedtype.Output" title="type std::ops::Sub::Output">Output</a></code><a class='srclink' href='../src/core/internal_macros.rs.html#54-56' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the <code>-</code> operation.</p>
</div></div><h3 id='impl-Neg' class='impl'><code class='in-band'>impl <a class="trait" href="../std/ops/trait.Neg.html" title="trait std::ops::Neg">Neg</a> for <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-Neg' class='anchor'></a><a class='srclink' href='../src/core/ops/arith.rs.html#624-630' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Output-4' class="type"><code id='Output.t-4'>type <a href='../std/ops/trait.Neg.html#associatedtype.Output' class="type">Output</a> = <a class="primitive" href="primitive.f64.html">f64</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>-</code> operator.</p>
</div><h4 id='method.neg' class="method hidden"><code id='neg.v'>fn <a href='../std/ops/trait.Neg.html#tymethod.neg' class='fnname'>neg</a>(self) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/core/ops/arith.rs.html#629' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the unary <code>-</code> operation.</p>
</div></div><h3 id='impl-Neg-1' class='impl'><code class='in-band'>impl&lt;'_&gt; <a class="trait" href="../std/ops/trait.Neg.html" title="trait std::ops::Neg">Neg</a> for &amp;'_ <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-Neg-1' class='anchor'></a><a class='srclink' href='../src/core/internal_macros.rs.html#10-17' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Output-5' class="type"><code id='Output.t-5'>type <a href='../std/ops/trait.Neg.html#associatedtype.Output' class="type">Output</a> = &lt;<a class="primitive" href="primitive.f64.html">f64</a> as <a class="trait" href="../std/ops/trait.Neg.html" title="trait std::ops::Neg">Neg</a>&gt;::<a class="type" href="../std/ops/trait.Neg.html#associatedtype.Output" title="type std::ops::Neg::Output">Output</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>-</code> operator.</p>
</div><h4 id='method.neg-1' class="method hidden"><code id='neg.v-1'>fn <a href='../std/ops/trait.Neg.html#tymethod.neg' class='fnname'>neg</a>(self) -&gt; &lt;<a class="primitive" href="primitive.f64.html">f64</a> as <a class="trait" href="../std/ops/trait.Neg.html" title="trait std::ops::Neg">Neg</a>&gt;::<a class="type" href="../std/ops/trait.Neg.html#associatedtype.Output" title="type std::ops::Neg::Output">Output</a></code><a class='srclink' href='../src/core/internal_macros.rs.html#14-16' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the unary <code>-</code> operation.</p>
</div></div><h3 id='impl-SubAssign%3C%26%27_%20f64%3E' class='impl'><code class='in-band'>impl&lt;'_&gt; <a class="trait" href="../std/ops/trait.SubAssign.html" title="trait std::ops::SubAssign">SubAssign</a>&lt;&amp;'_ <a class="primitive" href="primitive.f64.html">f64</a>&gt; for <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-SubAssign%3C%26%27_%20f64%3E' class='anchor'></a><div class='since' title='Stable since Rust version 1.22.0'>1.22.0</div><a class='srclink' href='../src/core/internal_macros.rs.html#70-75' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.sub_assign' class="method hidden"><code id='sub_assign.v'>fn <a href='../std/ops/trait.SubAssign.html#tymethod.sub_assign' class='fnname'>sub_assign</a>(&amp;mut self, other: &amp;<a class="primitive" href="primitive.f64.html">f64</a>)</code><a class='srclink' href='../src/core/internal_macros.rs.html#72-74' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the <code>-=</code> operation.</p>
</div></div><h3 id='impl-SubAssign%3Cf64%3E' class='impl'><code class='in-band'>impl <a class="trait" href="../std/ops/trait.SubAssign.html" title="trait std::ops::SubAssign">SubAssign</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt; for <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-SubAssign%3Cf64%3E' class='anchor'></a><div class='since' title='Stable since Rust version 1.8.0'>1.8.0</div><a class='srclink' href='../src/core/ops/arith.rs.html#751-755' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.sub_assign-1' class="method hidden"><code id='sub_assign.v-1'>fn <a href='../std/ops/trait.SubAssign.html#tymethod.sub_assign' class='fnname'>sub_assign</a>(&amp;mut self, other: <a class="primitive" href="primitive.f64.html">f64</a>)</code><a class='srclink' href='../src/core/ops/arith.rs.html#754' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the <code>-=</code> operation.</p>
</div></div><h3 id='impl-RemAssign%3C%26%27_%20f64%3E' class='impl'><code class='in-band'>impl&lt;'_&gt; <a class="trait" href="../std/ops/trait.RemAssign.html" title="trait std::ops::RemAssign">RemAssign</a>&lt;&amp;'_ <a class="primitive" href="primitive.f64.html">f64</a>&gt; for <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-RemAssign%3C%26%27_%20f64%3E' class='anchor'></a><div class='since' title='Stable since Rust version 1.22.0'>1.22.0</div><a class='srclink' href='../src/core/internal_macros.rs.html#70-75' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.rem_assign' class="method hidden"><code id='rem_assign.v'>fn <a href='../std/ops/trait.RemAssign.html#tymethod.rem_assign' class='fnname'>rem_assign</a>(&amp;mut self, other: &amp;<a class="primitive" href="primitive.f64.html">f64</a>)</code><a class='srclink' href='../src/core/internal_macros.rs.html#72-74' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the <code>%=</code> operation.</p>
</div></div><h3 id='impl-RemAssign%3Cf64%3E' class='impl'><code class='in-band'>impl <a class="trait" href="../std/ops/trait.RemAssign.html" title="trait std::ops::RemAssign">RemAssign</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt; for <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-RemAssign%3Cf64%3E' class='anchor'></a><div class='since' title='Stable since Rust version 1.8.0'>1.8.0</div><a class='srclink' href='../src/core/ops/arith.rs.html#895-898' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.rem_assign-1' class="method hidden"><code id='rem_assign.v-1'>fn <a href='../std/ops/trait.RemAssign.html#tymethod.rem_assign' class='fnname'>rem_assign</a>(&amp;mut self, other: <a class="primitive" href="primitive.f64.html">f64</a>)</code><a class='srclink' href='../src/core/ops/arith.rs.html#897' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the <code>%=</code> operation.</p>
</div></div><h3 id='impl-Default' class='impl'><code class='in-band'>impl <a class="trait" href="../std/default/trait.Default.html" title="trait std::default::Default">Default</a> for <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-Default' class='anchor'></a><a class='srclink' href='../src/core/default.rs.html#121-125' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.default' class="method"><code id='default.v'>fn <a href='../std/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/core/default.rs.html#124' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the default value of <code>0.0</code></p>
</div></div><h3 id='impl-Div%3C%26%27_%20f64%3E' class='impl'><code class='in-band'>impl&lt;'_, '_&gt; <a class="trait" href="../std/ops/trait.Div.html" title="trait std::ops::Div">Div</a>&lt;&amp;'_ <a class="primitive" href="primitive.f64.html">f64</a>&gt; for &amp;'_ <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-Div%3C%26%27_%20f64%3E' class='anchor'></a><a class='srclink' href='../src/core/internal_macros.rs.html#50-57' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Output-6' class="type"><code id='Output.t-6'>type <a href='../std/ops/trait.Div.html#associatedtype.Output' class="type">Output</a> = &lt;<a class="primitive" href="primitive.f64.html">f64</a> as <a class="trait" href="../std/ops/trait.Div.html" title="trait std::ops::Div">Div</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt;&gt;::<a class="type" href="../std/ops/trait.Div.html#associatedtype.Output" title="type std::ops::Div::Output">Output</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>/</code> operator.</p>
</div><h4 id='method.div' class="method hidden"><code id='div.v'>fn <a href='../std/ops/trait.Div.html#tymethod.div' class='fnname'>div</a>(self, other: &amp;<a class="primitive" href="primitive.f64.html">f64</a>) -&gt; &lt;<a class="primitive" href="primitive.f64.html">f64</a> as <a class="trait" href="../std/ops/trait.Div.html" title="trait std::ops::Div">Div</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt;&gt;::<a class="type" href="../std/ops/trait.Div.html#associatedtype.Output" title="type std::ops::Div::Output">Output</a></code><a class='srclink' href='../src/core/internal_macros.rs.html#54-56' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the <code>/</code> operation.</p>
</div></div><h3 id='impl-Div%3Cf64%3E' class='impl'><code class='in-band'>impl <a class="trait" href="../std/ops/trait.Div.html" title="trait std::ops::Div">Div</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt; for <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-Div%3Cf64%3E' class='anchor'></a><a class='srclink' href='../src/core/ops/arith.rs.html#455-460' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Output-7' class="type"><code id='Output.t-7'>type <a href='../std/ops/trait.Div.html#associatedtype.Output' class="type">Output</a> = <a class="primitive" href="primitive.f64.html">f64</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>/</code> operator.</p>
</div><h4 id='method.div-1' class="method hidden"><code id='div.v-1'>fn <a href='../std/ops/trait.Div.html#tymethod.div' class='fnname'>div</a>(self, other: <a class="primitive" href="primitive.f64.html">f64</a>) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/core/ops/arith.rs.html#459' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the <code>/</code> operation.</p>
</div></div><h3 id='impl-Div%3C%26%27_%20f64%3E-1' class='impl'><code class='in-band'>impl&lt;'_&gt; <a class="trait" href="../std/ops/trait.Div.html" title="trait std::ops::Div">Div</a>&lt;&amp;'_ <a class="primitive" href="primitive.f64.html">f64</a>&gt; for <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-Div%3C%26%27_%20f64%3E-1' class='anchor'></a><a class='srclink' href='../src/core/internal_macros.rs.html#40-47' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Output-8' class="type"><code id='Output.t-8'>type <a href='../std/ops/trait.Div.html#associatedtype.Output' class="type">Output</a> = &lt;<a class="primitive" href="primitive.f64.html">f64</a> as <a class="trait" href="../std/ops/trait.Div.html" title="trait std::ops::Div">Div</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt;&gt;::<a class="type" href="../std/ops/trait.Div.html#associatedtype.Output" title="type std::ops::Div::Output">Output</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>/</code> operator.</p>
</div><h4 id='method.div-2' class="method hidden"><code id='div.v-2'>fn <a href='../std/ops/trait.Div.html#tymethod.div' class='fnname'>div</a>(self, other: &amp;<a class="primitive" href="primitive.f64.html">f64</a>) -&gt; &lt;<a class="primitive" href="primitive.f64.html">f64</a> as <a class="trait" href="../std/ops/trait.Div.html" title="trait std::ops::Div">Div</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt;&gt;::<a class="type" href="../std/ops/trait.Div.html#associatedtype.Output" title="type std::ops::Div::Output">Output</a></code><a class='srclink' href='../src/core/internal_macros.rs.html#44-46' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the <code>/</code> operation.</p>
</div></div><h3 id='impl-Div%3Cf64%3E-1' class='impl'><code class='in-band'>impl&lt;'a&gt; <a class="trait" href="../std/ops/trait.Div.html" title="trait std::ops::Div">Div</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt; for &amp;'a <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-Div%3Cf64%3E-1' class='anchor'></a><a class='srclink' href='../src/core/internal_macros.rs.html#30-37' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Output-9' class="type"><code id='Output.t-9'>type <a href='../std/ops/trait.Div.html#associatedtype.Output' class="type">Output</a> = &lt;<a class="primitive" href="primitive.f64.html">f64</a> as <a class="trait" href="../std/ops/trait.Div.html" title="trait std::ops::Div">Div</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt;&gt;::<a class="type" href="../std/ops/trait.Div.html#associatedtype.Output" title="type std::ops::Div::Output">Output</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>/</code> operator.</p>
</div><h4 id='method.div-3' class="method hidden"><code id='div.v-3'>fn <a href='../std/ops/trait.Div.html#tymethod.div' class='fnname'>div</a>(self, other: <a class="primitive" href="primitive.f64.html">f64</a>) -&gt; &lt;<a class="primitive" href="primitive.f64.html">f64</a> as <a class="trait" href="../std/ops/trait.Div.html" title="trait std::ops::Div">Div</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt;&gt;::<a class="type" href="../std/ops/trait.Div.html#associatedtype.Output" title="type std::ops::Div::Output">Output</a></code><a class='srclink' href='../src/core/internal_macros.rs.html#34-36' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the <code>/</code> operation.</p>
</div></div><h3 id='impl-Display' class='impl'><code class='in-band'>impl <a class="trait" href="../std/fmt/trait.Display.html" title="trait std::fmt::Display">Display</a> for <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-Display' class='anchor'></a><a class='srclink' href='../src/core/fmt/float.rs.html#132-136' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method hidden"><code id='fmt.v-1'>fn <a href='../std/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, fmt: &amp;mut <a class="struct" href="../std/fmt/struct.Formatter.html" title="struct std::fmt::Formatter">Formatter</a>) -&gt; <a class="enum" href="../std/result/enum.Result.html" title="enum std::result::Result">Result</a>&lt;<a class="primitive" href="primitive.unit.html">()</a>, <a class="struct" href="../std/fmt/struct.Error.html" title="struct std::fmt::Error">Error</a>&gt;</code><a class='srclink' href='../src/core/fmt/float.rs.html#133-135' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="../std/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id='impl-PartialOrd%3Cf64%3E' class='impl'><code class='in-band'>impl <a class="trait" href="../std/cmp/trait.PartialOrd.html" title="trait std::cmp::PartialOrd">PartialOrd</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt; for <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-PartialOrd%3Cf64%3E' class='anchor'></a><a class='srclink' href='../src/core/cmp.rs.html#925-943' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.partial_cmp' class="method hidden"><code id='partial_cmp.v'>fn <a href='../std/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&amp;self, other: &amp;<a class="primitive" href="primitive.f64.html">f64</a>) -&gt; <a class="enum" href="../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;<a class="enum" href="../std/cmp/enum.Ordering.html" title="enum std::cmp::Ordering">Ordering</a>&gt;</code><a class='srclink' href='../src/core/cmp.rs.html#927-934' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="../std/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
</div><h4 id='method.lt' class="method hidden"><code id='lt.v'>fn <a href='../std/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&amp;self, other: &amp;<a class="primitive" href="primitive.f64.html">f64</a>) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code><a class='srclink' href='../src/core/cmp.rs.html#936' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;</code> operator. <a href="../std/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
</div><h4 id='method.le' class="method hidden"><code id='le.v'>fn <a href='../std/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&amp;self, other: &amp;<a class="primitive" href="primitive.f64.html">f64</a>) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code><a class='srclink' href='../src/core/cmp.rs.html#938' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;=</code> operator. <a href="../std/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
</div><h4 id='method.ge' class="method hidden"><code id='ge.v'>fn <a href='../std/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&amp;self, other: &amp;<a class="primitive" href="primitive.f64.html">f64</a>) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code><a class='srclink' href='../src/core/cmp.rs.html#940' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;=</code> operator. <a href="../std/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
</div><h4 id='method.gt' class="method hidden"><code id='gt.v'>fn <a href='../std/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&amp;self, other: &amp;<a class="primitive" href="primitive.f64.html">f64</a>) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code><a class='srclink' href='../src/core/cmp.rs.html#942' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;</code> operator. <a href="../std/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
</div></div><h3 id='impl-PartialEq%3Cf64%3E' class='impl'><code class='in-band'>impl <a class="trait" href="../std/cmp/trait.PartialEq.html" title="trait std::cmp::PartialEq">PartialEq</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt; for <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-PartialEq%3Cf64%3E' class='anchor'></a><a class='srclink' href='../src/core/cmp.rs.html#892-897' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code id='eq.v'>fn <a href='../std/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&amp;self, other: &amp;<a class="primitive" href="primitive.f64.html">f64</a>) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code><a class='srclink' href='../src/core/cmp.rs.html#894' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="../std/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
</div><h4 id='method.ne' class="method hidden"><code id='ne.v'>fn <a href='../std/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&amp;self, other: &amp;<a class="primitive" href="primitive.f64.html">f64</a>) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code><a class='srclink' href='../src/core/cmp.rs.html#896' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
</div></div><h3 id='impl-AddAssign%3C%26%27_%20f64%3E' class='impl'><code class='in-band'>impl&lt;'_&gt; <a class="trait" href="../std/ops/trait.AddAssign.html" title="trait std::ops::AddAssign">AddAssign</a>&lt;&amp;'_ <a class="primitive" href="primitive.f64.html">f64</a>&gt; for <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-AddAssign%3C%26%27_%20f64%3E' class='anchor'></a><div class='since' title='Stable since Rust version 1.22.0'>1.22.0</div><a class='srclink' href='../src/core/internal_macros.rs.html#70-75' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.add_assign' class="method hidden"><code id='add_assign.v'>fn <a href='../std/ops/trait.AddAssign.html#tymethod.add_assign' class='fnname'>add_assign</a>(&amp;mut self, other: &amp;<a class="primitive" href="primitive.f64.html">f64</a>)</code><a class='srclink' href='../src/core/internal_macros.rs.html#72-74' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the <code>+=</code> operation.</p>
</div></div><h3 id='impl-AddAssign%3Cf64%3E' class='impl'><code class='in-band'>impl <a class="trait" href="../std/ops/trait.AddAssign.html" title="trait std::ops::AddAssign">AddAssign</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt; for <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-AddAssign%3Cf64%3E' class='anchor'></a><div class='since' title='Stable since Rust version 1.8.0'>1.8.0</div><a class='srclink' href='../src/core/ops/arith.rs.html#695-699' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.add_assign-1' class="method hidden"><code id='add_assign.v-1'>fn <a href='../std/ops/trait.AddAssign.html#tymethod.add_assign' class='fnname'>add_assign</a>(&amp;mut self, other: <a class="primitive" href="primitive.f64.html">f64</a>)</code><a class='srclink' href='../src/core/ops/arith.rs.html#698' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the <code>+=</code> operation.</p>
</div></div><h3 id='impl-DivAssign%3C%26%27_%20f64%3E' class='impl'><code class='in-band'>impl&lt;'_&gt; <a class="trait" href="../std/ops/trait.DivAssign.html" title="trait std::ops::DivAssign">DivAssign</a>&lt;&amp;'_ <a class="primitive" href="primitive.f64.html">f64</a>&gt; for <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-DivAssign%3C%26%27_%20f64%3E' class='anchor'></a><div class='since' title='Stable since Rust version 1.22.0'>1.22.0</div><a class='srclink' href='../src/core/internal_macros.rs.html#70-75' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.div_assign' class="method hidden"><code id='div_assign.v'>fn <a href='../std/ops/trait.DivAssign.html#tymethod.div_assign' class='fnname'>div_assign</a>(&amp;mut self, other: &amp;<a class="primitive" href="primitive.f64.html">f64</a>)</code><a class='srclink' href='../src/core/internal_macros.rs.html#72-74' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the <code>/=</code> operation.</p>
</div></div><h3 id='impl-DivAssign%3Cf64%3E' class='impl'><code class='in-band'>impl <a class="trait" href="../std/ops/trait.DivAssign.html" title="trait std::ops::DivAssign">DivAssign</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt; for <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-DivAssign%3Cf64%3E' class='anchor'></a><div class='since' title='Stable since Rust version 1.8.0'>1.8.0</div><a class='srclink' href='../src/core/ops/arith.rs.html#845-848' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.div_assign-1' class="method hidden"><code id='div_assign.v-1'>fn <a href='../std/ops/trait.DivAssign.html#tymethod.div_assign' class='fnname'>div_assign</a>(&amp;mut self, other: <a class="primitive" href="primitive.f64.html">f64</a>)</code><a class='srclink' href='../src/core/ops/arith.rs.html#847' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the <code>/=</code> operation.</p>
</div></div><h3 id='impl-Add%3Cf64%3E' class='impl'><code class='in-band'>impl&lt;'a&gt; <a class="trait" href="../std/ops/trait.Add.html" title="trait std::ops::Add">Add</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt; for &amp;'a <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-Add%3Cf64%3E' class='anchor'></a><a class='srclink' href='../src/core/internal_macros.rs.html#30-37' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Output-10' class="type"><code id='Output.t-10'>type <a href='../std/ops/trait.Add.html#associatedtype.Output' class="type">Output</a> = &lt;<a class="primitive" href="primitive.f64.html">f64</a> as <a class="trait" href="../std/ops/trait.Add.html" title="trait std::ops::Add">Add</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt;&gt;::<a class="type" href="../std/ops/trait.Add.html#associatedtype.Output" title="type std::ops::Add::Output">Output</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>+</code> operator.</p>
</div><h4 id='method.add' class="method hidden"><code id='add.v'>fn <a href='../std/ops/trait.Add.html#tymethod.add' class='fnname'>add</a>(self, other: <a class="primitive" href="primitive.f64.html">f64</a>) -&gt; &lt;<a class="primitive" href="primitive.f64.html">f64</a> as <a class="trait" href="../std/ops/trait.Add.html" title="trait std::ops::Add">Add</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt;&gt;::<a class="type" href="../std/ops/trait.Add.html#associatedtype.Output" title="type std::ops::Add::Output">Output</a></code><a class='srclink' href='../src/core/internal_macros.rs.html#34-36' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the <code>+</code> operation.</p>
</div></div><h3 id='impl-Add%3C%26%27_%20f64%3E' class='impl'><code class='in-band'>impl&lt;'_, '_&gt; <a class="trait" href="../std/ops/trait.Add.html" title="trait std::ops::Add">Add</a>&lt;&amp;'_ <a class="primitive" href="primitive.f64.html">f64</a>&gt; for &amp;'_ <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-Add%3C%26%27_%20f64%3E' class='anchor'></a><a class='srclink' href='../src/core/internal_macros.rs.html#50-57' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Output-11' class="type"><code id='Output.t-11'>type <a href='../std/ops/trait.Add.html#associatedtype.Output' class="type">Output</a> = &lt;<a class="primitive" href="primitive.f64.html">f64</a> as <a class="trait" href="../std/ops/trait.Add.html" title="trait std::ops::Add">Add</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt;&gt;::<a class="type" href="../std/ops/trait.Add.html#associatedtype.Output" title="type std::ops::Add::Output">Output</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>+</code> operator.</p>
</div><h4 id='method.add-1' class="method hidden"><code id='add.v-1'>fn <a href='../std/ops/trait.Add.html#tymethod.add' class='fnname'>add</a>(self, other: &amp;<a class="primitive" href="primitive.f64.html">f64</a>) -&gt; &lt;<a class="primitive" href="primitive.f64.html">f64</a> as <a class="trait" href="../std/ops/trait.Add.html" title="trait std::ops::Add">Add</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt;&gt;::<a class="type" href="../std/ops/trait.Add.html#associatedtype.Output" title="type std::ops::Add::Output">Output</a></code><a class='srclink' href='../src/core/internal_macros.rs.html#54-56' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the <code>+</code> operation.</p>
</div></div><h3 id='impl-Add%3Cf64%3E-1' class='impl'><code class='in-band'>impl <a class="trait" href="../std/ops/trait.Add.html" title="trait std::ops::Add">Add</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt; for <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-Add%3Cf64%3E-1' class='anchor'></a><a class='srclink' href='../src/core/ops/arith.rs.html#95-101' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Output-12' class="type"><code id='Output.t-12'>type <a href='../std/ops/trait.Add.html#associatedtype.Output' class="type">Output</a> = <a class="primitive" href="primitive.f64.html">f64</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>+</code> operator.</p>
</div><h4 id='method.add-2' class="method hidden"><code id='add.v-2'>fn <a href='../std/ops/trait.Add.html#tymethod.add' class='fnname'>add</a>(self, other: <a class="primitive" href="primitive.f64.html">f64</a>) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/core/ops/arith.rs.html#100' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the <code>+</code> operation.</p>
</div></div><h3 id='impl-Add%3C%26%27_%20f64%3E-1' class='impl'><code class='in-band'>impl&lt;'_&gt; <a class="trait" href="../std/ops/trait.Add.html" title="trait std::ops::Add">Add</a>&lt;&amp;'_ <a class="primitive" href="primitive.f64.html">f64</a>&gt; for <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-Add%3C%26%27_%20f64%3E-1' class='anchor'></a><a class='srclink' href='../src/core/internal_macros.rs.html#40-47' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Output-13' class="type"><code id='Output.t-13'>type <a href='../std/ops/trait.Add.html#associatedtype.Output' class="type">Output</a> = &lt;<a class="primitive" href="primitive.f64.html">f64</a> as <a class="trait" href="../std/ops/trait.Add.html" title="trait std::ops::Add">Add</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt;&gt;::<a class="type" href="../std/ops/trait.Add.html#associatedtype.Output" title="type std::ops::Add::Output">Output</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>+</code> operator.</p>
</div><h4 id='method.add-3' class="method hidden"><code id='add.v-3'>fn <a href='../std/ops/trait.Add.html#tymethod.add' class='fnname'>add</a>(self, other: &amp;<a class="primitive" href="primitive.f64.html">f64</a>) -&gt; &lt;<a class="primitive" href="primitive.f64.html">f64</a> as <a class="trait" href="../std/ops/trait.Add.html" title="trait std::ops::Add">Add</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt;&gt;::<a class="type" href="../std/ops/trait.Add.html#associatedtype.Output" title="type std::ops::Add::Output">Output</a></code><a class='srclink' href='../src/core/internal_macros.rs.html#44-46' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the <code>+</code> operation.</p>
</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="../std/fmt/trait.Debug.html" title="trait std::fmt::Debug">Debug</a> for <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../src/core/fmt/float.rs.html#125-129' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt-2' class="method hidden"><code id='fmt.v-2'>fn <a href='../std/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, fmt: &amp;mut <a class="struct" href="../std/fmt/struct.Formatter.html" title="struct std::fmt::Formatter">Formatter</a>) -&gt; <a class="enum" href="../std/result/enum.Result.html" title="enum std::result::Result">Result</a>&lt;<a class="primitive" href="primitive.unit.html">()</a>, <a class="struct" href="../std/fmt/struct.Error.html" title="struct std::fmt::Error">Error</a>&gt;</code><a class='srclink' href='../src/core/fmt/float.rs.html#126-128' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="../std/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id='impl-Mul%3C%26%27_%20f64%3E' class='impl'><code class='in-band'>impl&lt;'_, '_&gt; <a class="trait" href="../std/ops/trait.Mul.html" title="trait std::ops::Mul">Mul</a>&lt;&amp;'_ <a class="primitive" href="primitive.f64.html">f64</a>&gt; for &amp;'_ <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-Mul%3C%26%27_%20f64%3E' class='anchor'></a><a class='srclink' href='../src/core/internal_macros.rs.html#50-57' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Output-14' class="type"><code id='Output.t-14'>type <a href='../std/ops/trait.Mul.html#associatedtype.Output' class="type">Output</a> = &lt;<a class="primitive" href="primitive.f64.html">f64</a> as <a class="trait" href="../std/ops/trait.Mul.html" title="trait std::ops::Mul">Mul</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt;&gt;::<a class="type" href="../std/ops/trait.Mul.html#associatedtype.Output" title="type std::ops::Mul::Output">Output</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>*</code> operator.</p>
</div><h4 id='method.mul' class="method hidden"><code id='mul.v'>fn <a href='../std/ops/trait.Mul.html#tymethod.mul' class='fnname'>mul</a>(self, other: &amp;<a class="primitive" href="primitive.f64.html">f64</a>) -&gt; &lt;<a class="primitive" href="primitive.f64.html">f64</a> as <a class="trait" href="../std/ops/trait.Mul.html" title="trait std::ops::Mul">Mul</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt;&gt;::<a class="type" href="../std/ops/trait.Mul.html#associatedtype.Output" title="type std::ops::Mul::Output">Output</a></code><a class='srclink' href='../src/core/internal_macros.rs.html#54-56' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the <code>*</code> operation.</p>
</div></div><h3 id='impl-Mul%3C%26%27_%20f64%3E-1' class='impl'><code class='in-band'>impl&lt;'_&gt; <a class="trait" href="../std/ops/trait.Mul.html" title="trait std::ops::Mul">Mul</a>&lt;&amp;'_ <a class="primitive" href="primitive.f64.html">f64</a>&gt; for <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-Mul%3C%26%27_%20f64%3E-1' class='anchor'></a><a class='srclink' href='../src/core/internal_macros.rs.html#40-47' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Output-15' class="type"><code id='Output.t-15'>type <a href='../std/ops/trait.Mul.html#associatedtype.Output' class="type">Output</a> = &lt;<a class="primitive" href="primitive.f64.html">f64</a> as <a class="trait" href="../std/ops/trait.Mul.html" title="trait std::ops::Mul">Mul</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt;&gt;::<a class="type" href="../std/ops/trait.Mul.html#associatedtype.Output" title="type std::ops::Mul::Output">Output</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>*</code> operator.</p>
</div><h4 id='method.mul-1' class="method hidden"><code id='mul.v-1'>fn <a href='../std/ops/trait.Mul.html#tymethod.mul' class='fnname'>mul</a>(self, other: &amp;<a class="primitive" href="primitive.f64.html">f64</a>) -&gt; &lt;<a class="primitive" href="primitive.f64.html">f64</a> as <a class="trait" href="../std/ops/trait.Mul.html" title="trait std::ops::Mul">Mul</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt;&gt;::<a class="type" href="../std/ops/trait.Mul.html#associatedtype.Output" title="type std::ops::Mul::Output">Output</a></code><a class='srclink' href='../src/core/internal_macros.rs.html#44-46' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the <code>*</code> operation.</p>
</div></div><h3 id='impl-Mul%3Cf64%3E' class='impl'><code class='in-band'>impl&lt;'a&gt; <a class="trait" href="../std/ops/trait.Mul.html" title="trait std::ops::Mul">Mul</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt; for &amp;'a <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-Mul%3Cf64%3E' class='anchor'></a><a class='srclink' href='../src/core/internal_macros.rs.html#30-37' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Output-16' class="type"><code id='Output.t-16'>type <a href='../std/ops/trait.Mul.html#associatedtype.Output' class="type">Output</a> = &lt;<a class="primitive" href="primitive.f64.html">f64</a> as <a class="trait" href="../std/ops/trait.Mul.html" title="trait std::ops::Mul">Mul</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt;&gt;::<a class="type" href="../std/ops/trait.Mul.html#associatedtype.Output" title="type std::ops::Mul::Output">Output</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>*</code> operator.</p>
</div><h4 id='method.mul-2' class="method hidden"><code id='mul.v-2'>fn <a href='../std/ops/trait.Mul.html#tymethod.mul' class='fnname'>mul</a>(self, other: <a class="primitive" href="primitive.f64.html">f64</a>) -&gt; &lt;<a class="primitive" href="primitive.f64.html">f64</a> as <a class="trait" href="../std/ops/trait.Mul.html" title="trait std::ops::Mul">Mul</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt;&gt;::<a class="type" href="../std/ops/trait.Mul.html#associatedtype.Output" title="type std::ops::Mul::Output">Output</a></code><a class='srclink' href='../src/core/internal_macros.rs.html#34-36' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the <code>*</code> operation.</p>
</div></div><h3 id='impl-Mul%3Cf64%3E-1' class='impl'><code class='in-band'>impl <a class="trait" href="../std/ops/trait.Mul.html" title="trait std::ops::Mul">Mul</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt; for <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-Mul%3Cf64%3E-1' class='anchor'></a><a class='srclink' href='../src/core/ops/arith.rs.html#313-319' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Output-17' class="type"><code id='Output.t-17'>type <a href='../std/ops/trait.Mul.html#associatedtype.Output' class="type">Output</a> = <a class="primitive" href="primitive.f64.html">f64</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>*</code> operator.</p>
</div><h4 id='method.mul-3' class="method hidden"><code id='mul.v-3'>fn <a href='../std/ops/trait.Mul.html#tymethod.mul' class='fnname'>mul</a>(self, other: <a class="primitive" href="primitive.f64.html">f64</a>) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/core/ops/arith.rs.html#318' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the <code>*</code> operation.</p>
</div></div><h3 id='impl-Rem%3Cf64%3E' class='impl'><code class='in-band'>impl <a class="trait" href="../std/ops/trait.Rem.html" title="trait std::ops::Rem">Rem</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt; for <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-Rem%3Cf64%3E' class='anchor'></a><a class='srclink' href='../src/core/ops/arith.rs.html#556-561' title='goto source code'>[src]</a></h3><div class='docblock'><p>The remainder from the division of two floats.</p>
<p>The remainder has the same sign as the dividend and is computed as:
<code>x - (x / y).trunc() * y</code>.</p>
<h1 id="examples-42" class="section-header"><a href="#examples-42">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">x</span>: <span class="ident">f32</span> <span class="op">=</span> <span class="number">50.50</span>;
<span class="kw">let</span> <span class="ident">y</span>: <span class="ident">f32</span> <span class="op">=</span> <span class="number">8.125</span>;
<span class="kw">let</span> <span class="ident">remainder</span> <span class="op">=</span> <span class="ident">x</span> <span class="op">-</span> (<span class="ident">x</span> <span class="op">/</span> <span class="ident">y</span>).<span class="ident">trunc</span>() <span class="op">*</span> <span class="ident">y</span>;

<span class="comment">// The answer to both operations is 1.75</span>
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">x</span> <span class="op">%</span> <span class="ident">y</span>, <span class="ident">remainder</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Alet%20x%3A%20f32%20%3D%2050.50%3B%0Alet%20y%3A%20f32%20%3D%208.125%3B%0Alet%20remainder%20%3D%20x%20-%20(x%20%2F%20y).trunc()%20*%20y%3B%0A%0A%2F%2F%20The%20answer%20to%20both%20operations%20is%201.75%0Aassert_eq!(x%20%25%20y%2C%20remainder)%3B%0A%7D">Run</a></pre></div>
</div><div class='impl-items'><h4 id='associatedtype.Output-18' class="type"><code id='Output.t-18'>type <a href='../std/ops/trait.Rem.html#associatedtype.Output' class="type">Output</a> = <a class="primitive" href="primitive.f64.html">f64</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>%</code> operator.</p>
</div><h4 id='method.rem' class="method hidden"><code id='rem.v'>fn <a href='../std/ops/trait.Rem.html#tymethod.rem' class='fnname'>rem</a>(self, other: <a class="primitive" href="primitive.f64.html">f64</a>) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/core/ops/arith.rs.html#560' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the <code>%</code> operation.</p>
</div></div><h3 id='impl-Rem%3C%26%27_%20f64%3E' class='impl'><code class='in-band'>impl&lt;'_&gt; <a class="trait" href="../std/ops/trait.Rem.html" title="trait std::ops::Rem">Rem</a>&lt;&amp;'_ <a class="primitive" href="primitive.f64.html">f64</a>&gt; for <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-Rem%3C%26%27_%20f64%3E' class='anchor'></a><a class='srclink' href='../src/core/internal_macros.rs.html#40-47' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Output-19' class="type"><code id='Output.t-19'>type <a href='../std/ops/trait.Rem.html#associatedtype.Output' class="type">Output</a> = &lt;<a class="primitive" href="primitive.f64.html">f64</a> as <a class="trait" href="../std/ops/trait.Rem.html" title="trait std::ops::Rem">Rem</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt;&gt;::<a class="type" href="../std/ops/trait.Rem.html#associatedtype.Output" title="type std::ops::Rem::Output">Output</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>%</code> operator.</p>
</div><h4 id='method.rem-1' class="method hidden"><code id='rem.v-1'>fn <a href='../std/ops/trait.Rem.html#tymethod.rem' class='fnname'>rem</a>(self, other: &amp;<a class="primitive" href="primitive.f64.html">f64</a>) -&gt; &lt;<a class="primitive" href="primitive.f64.html">f64</a> as <a class="trait" href="../std/ops/trait.Rem.html" title="trait std::ops::Rem">Rem</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt;&gt;::<a class="type" href="../std/ops/trait.Rem.html#associatedtype.Output" title="type std::ops::Rem::Output">Output</a></code><a class='srclink' href='../src/core/internal_macros.rs.html#44-46' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the <code>%</code> operation.</p>
</div></div><h3 id='impl-Rem%3Cf64%3E-1' class='impl'><code class='in-band'>impl&lt;'a&gt; <a class="trait" href="../std/ops/trait.Rem.html" title="trait std::ops::Rem">Rem</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt; for &amp;'a <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-Rem%3Cf64%3E-1' class='anchor'></a><a class='srclink' href='../src/core/internal_macros.rs.html#30-37' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Output-20' class="type"><code id='Output.t-20'>type <a href='../std/ops/trait.Rem.html#associatedtype.Output' class="type">Output</a> = &lt;<a class="primitive" href="primitive.f64.html">f64</a> as <a class="trait" href="../std/ops/trait.Rem.html" title="trait std::ops::Rem">Rem</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt;&gt;::<a class="type" href="../std/ops/trait.Rem.html#associatedtype.Output" title="type std::ops::Rem::Output">Output</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>%</code> operator.</p>
</div><h4 id='method.rem-2' class="method hidden"><code id='rem.v-2'>fn <a href='../std/ops/trait.Rem.html#tymethod.rem' class='fnname'>rem</a>(self, other: <a class="primitive" href="primitive.f64.html">f64</a>) -&gt; &lt;<a class="primitive" href="primitive.f64.html">f64</a> as <a class="trait" href="../std/ops/trait.Rem.html" title="trait std::ops::Rem">Rem</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt;&gt;::<a class="type" href="../std/ops/trait.Rem.html#associatedtype.Output" title="type std::ops::Rem::Output">Output</a></code><a class='srclink' href='../src/core/internal_macros.rs.html#34-36' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the <code>%</code> operation.</p>
</div></div><h3 id='impl-Rem%3C%26%27_%20f64%3E-1' class='impl'><code class='in-band'>impl&lt;'_, '_&gt; <a class="trait" href="../std/ops/trait.Rem.html" title="trait std::ops::Rem">Rem</a>&lt;&amp;'_ <a class="primitive" href="primitive.f64.html">f64</a>&gt; for &amp;'_ <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-Rem%3C%26%27_%20f64%3E-1' class='anchor'></a><a class='srclink' href='../src/core/internal_macros.rs.html#50-57' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Output-21' class="type"><code id='Output.t-21'>type <a href='../std/ops/trait.Rem.html#associatedtype.Output' class="type">Output</a> = &lt;<a class="primitive" href="primitive.f64.html">f64</a> as <a class="trait" href="../std/ops/trait.Rem.html" title="trait std::ops::Rem">Rem</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt;&gt;::<a class="type" href="../std/ops/trait.Rem.html#associatedtype.Output" title="type std::ops::Rem::Output">Output</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>%</code> operator.</p>
</div><h4 id='method.rem-3' class="method hidden"><code id='rem.v-3'>fn <a href='../std/ops/trait.Rem.html#tymethod.rem' class='fnname'>rem</a>(self, other: &amp;<a class="primitive" href="primitive.f64.html">f64</a>) -&gt; &lt;<a class="primitive" href="primitive.f64.html">f64</a> as <a class="trait" href="../std/ops/trait.Rem.html" title="trait std::ops::Rem">Rem</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt;&gt;::<a class="type" href="../std/ops/trait.Rem.html#associatedtype.Output" title="type std::ops::Rem::Output">Output</a></code><a class='srclink' href='../src/core/internal_macros.rs.html#54-56' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the <code>%</code> operation.</p>
</div></div><h3 id='impl-Copy' class='impl'><code class='in-band'>impl <a class="trait" href="../std/marker/trait.Copy.html" title="trait std::marker::Copy">Copy</a> for <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-Copy' class='anchor'></a><a class='srclink' href='../src/core/marker.rs.html#670' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-MulAssign%3Cf64%3E' class='impl'><code class='in-band'>impl <a class="trait" href="../std/ops/trait.MulAssign.html" title="trait std::ops::MulAssign">MulAssign</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt; for <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-MulAssign%3Cf64%3E' class='anchor'></a><div class='since' title='Stable since Rust version 1.8.0'>1.8.0</div><a class='srclink' href='../src/core/ops/arith.rs.html#798-802' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.mul_assign' class="method hidden"><code id='mul_assign.v'>fn <a href='../std/ops/trait.MulAssign.html#tymethod.mul_assign' class='fnname'>mul_assign</a>(&amp;mut self, other: <a class="primitive" href="primitive.f64.html">f64</a>)</code><a class='srclink' href='../src/core/ops/arith.rs.html#801' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the <code>*=</code> operation.</p>
</div></div><h3 id='impl-MulAssign%3C%26%27_%20f64%3E' class='impl'><code class='in-band'>impl&lt;'_&gt; <a class="trait" href="../std/ops/trait.MulAssign.html" title="trait std::ops::MulAssign">MulAssign</a>&lt;&amp;'_ <a class="primitive" href="primitive.f64.html">f64</a>&gt; for <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-MulAssign%3C%26%27_%20f64%3E' class='anchor'></a><div class='since' title='Stable since Rust version 1.22.0'>1.22.0</div><a class='srclink' href='../src/core/internal_macros.rs.html#70-75' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.mul_assign-1' class="method hidden"><code id='mul_assign.v-1'>fn <a href='../std/ops/trait.MulAssign.html#tymethod.mul_assign' class='fnname'>mul_assign</a>(&amp;mut self, other: &amp;<a class="primitive" href="primitive.f64.html">f64</a>)</code><a class='srclink' href='../src/core/internal_macros.rs.html#72-74' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the <code>*=</code> operation.</p>
</div></div><h3 id='impl-UpperExp' class='impl'><code class='in-band'>impl <a class="trait" href="../std/fmt/trait.UpperExp.html" title="trait std::fmt::UpperExp">UpperExp</a> for <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-UpperExp' class='anchor'></a><a class='srclink' href='../src/core/fmt/float.rs.html#146-150' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt-3' class="method hidden"><code id='fmt.v-3'>fn <a href='../std/fmt/trait.UpperExp.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, fmt: &amp;mut <a class="struct" href="../std/fmt/struct.Formatter.html" title="struct std::fmt::Formatter">Formatter</a>) -&gt; <a class="enum" href="../std/result/enum.Result.html" title="enum std::result::Result">Result</a>&lt;<a class="primitive" href="primitive.unit.html">()</a>, <a class="struct" href="../std/fmt/struct.Error.html" title="struct std::fmt::Error">Error</a>&gt;</code><a class='srclink' href='../src/core/fmt/float.rs.html#147-149' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter.</p>
</div></div><h3 id='impl-Product%3Cf64%3E' class='impl'><code class='in-band'>impl <a class="trait" href="../std/iter/trait.Product.html" title="trait std::iter::Product">Product</a>&lt;<a class="primitive" href="primitive.f64.html">f64</a>&gt; for <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-Product%3Cf64%3E' class='anchor'></a><div class='since' title='Stable since Rust version 1.12.0'>1.12.0</div><a class='srclink' href='../src/core/iter/traits/accum.rs.html#92-96' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.product' class="method hidden"><code id='product.v'>fn <a href='../std/iter/trait.Product.html#tymethod.product' class='fnname'>product</a>&lt;I&gt;(iter: I) -&gt; <a class="primitive" href="primitive.f64.html">f64</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;I: <a class="trait" href="../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a>&lt;Item = <a class="primitive" href="primitive.f64.html">f64</a>&gt;,&nbsp;</span></code><a class='srclink' href='../src/core/iter/traits/accum.rs.html#93-95' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Method which takes an iterator and generates <code>Self</code> from the elements by multiplying the items. <a href="../std/iter/trait.Product.html#tymethod.product">Read more</a></p>
</div></div><h3 id='impl-Product%3C%26%27a%20f64%3E' class='impl'><code class='in-band'>impl&lt;'a&gt; <a class="trait" href="../std/iter/trait.Product.html" title="trait std::iter::Product">Product</a>&lt;&amp;'a <a class="primitive" href="primitive.f64.html">f64</a>&gt; for <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-Product%3C%26%27a%20f64%3E' class='anchor'></a><div class='since' title='Stable since Rust version 1.12.0'>1.12.0</div><a class='srclink' href='../src/core/iter/traits/accum.rs.html#106-110' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.product-1' class="method hidden"><code id='product.v-1'>fn <a href='../std/iter/trait.Product.html#tymethod.product' class='fnname'>product</a>&lt;I&gt;(iter: I) -&gt; <a class="primitive" href="primitive.f64.html">f64</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;I: <a class="trait" href="../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a>&lt;Item = &amp;'a <a class="primitive" href="primitive.f64.html">f64</a>&gt;,&nbsp;</span></code><a class='srclink' href='../src/core/iter/traits/accum.rs.html#107-109' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Method which takes an iterator and generates <code>Self</code> from the elements by multiplying the items. <a href="../std/iter/trait.Product.html#tymethod.product">Read more</a></p>
</div></div><h3 id='impl-From%3Ci16%3E' class='impl'><code class='in-band'>impl <a class="trait" href="../std/convert/trait.From.html" title="trait std::convert::From">From</a>&lt;<a class="primitive" href="primitive.i16.html">i16</a>&gt; for <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-From%3Ci16%3E' class='anchor'></a><div class='since' title='Stable since Rust version 1.6.0'>1.6.0</div><a class='srclink' href='../src/core/num/mod.rs.html#4838-4843' title='goto source code'>[src]</a></h3><div class='docblock'><p>Converts <code>i16</code> to <code>f64</code> losslessly.</p>
</div><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='../std/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(small: <a class="primitive" href="primitive.i16.html">i16</a>) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/core/num/mod.rs.html#4840-4842' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-From%3Ci32%3E' class='impl'><code class='in-band'>impl <a class="trait" href="../std/convert/trait.From.html" title="trait std::convert::From">From</a>&lt;<a class="primitive" href="primitive.i32.html">i32</a>&gt; for <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-From%3Ci32%3E' class='anchor'></a><div class='since' title='Stable since Rust version 1.6.0'>1.6.0</div><a class='srclink' href='../src/core/num/mod.rs.html#4838-4843' title='goto source code'>[src]</a></h3><div class='docblock'><p>Converts <code>i32</code> to <code>f64</code> losslessly.</p>
</div><div class='impl-items'><h4 id='method.from-1' class="method hidden"><code id='from.v-1'>fn <a href='../std/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(small: <a class="primitive" href="primitive.i32.html">i32</a>) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/core/num/mod.rs.html#4840-4842' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-From%3Cu16%3E' class='impl'><code class='in-band'>impl <a class="trait" href="../std/convert/trait.From.html" title="trait std::convert::From">From</a>&lt;<a class="primitive" href="primitive.u16.html">u16</a>&gt; for <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-From%3Cu16%3E' class='anchor'></a><div class='since' title='Stable since Rust version 1.6.0'>1.6.0</div><a class='srclink' href='../src/core/num/mod.rs.html#4838-4843' title='goto source code'>[src]</a></h3><div class='docblock'><p>Converts <code>u16</code> to <code>f64</code> losslessly.</p>
</div><div class='impl-items'><h4 id='method.from-2' class="method hidden"><code id='from.v-2'>fn <a href='../std/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(small: <a class="primitive" href="primitive.u16.html">u16</a>) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/core/num/mod.rs.html#4840-4842' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-From%3Ci8%3E' class='impl'><code class='in-band'>impl <a class="trait" href="../std/convert/trait.From.html" title="trait std::convert::From">From</a>&lt;<a class="primitive" href="primitive.i8.html">i8</a>&gt; for <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-From%3Ci8%3E' class='anchor'></a><div class='since' title='Stable since Rust version 1.6.0'>1.6.0</div><a class='srclink' href='../src/core/num/mod.rs.html#4838-4843' title='goto source code'>[src]</a></h3><div class='docblock'><p>Converts <code>i8</code> to <code>f64</code> losslessly.</p>
</div><div class='impl-items'><h4 id='method.from-3' class="method hidden"><code id='from.v-3'>fn <a href='../std/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(small: <a class="primitive" href="primitive.i8.html">i8</a>) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/core/num/mod.rs.html#4840-4842' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-From%3Cu32%3E' class='impl'><code class='in-band'>impl <a class="trait" href="../std/convert/trait.From.html" title="trait std::convert::From">From</a>&lt;<a class="primitive" href="primitive.u32.html">u32</a>&gt; for <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-From%3Cu32%3E' class='anchor'></a><div class='since' title='Stable since Rust version 1.6.0'>1.6.0</div><a class='srclink' href='../src/core/num/mod.rs.html#4838-4843' title='goto source code'>[src]</a></h3><div class='docblock'><p>Converts <code>u32</code> to <code>f64</code> losslessly.</p>
</div><div class='impl-items'><h4 id='method.from-4' class="method hidden"><code id='from.v-4'>fn <a href='../std/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(small: <a class="primitive" href="primitive.u32.html">u32</a>) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/core/num/mod.rs.html#4840-4842' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-From%3Cf32%3E' class='impl'><code class='in-band'>impl <a class="trait" href="../std/convert/trait.From.html" title="trait std::convert::From">From</a>&lt;<a class="primitive" href="primitive.f32.html">f32</a>&gt; for <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-From%3Cf32%3E' class='anchor'></a><div class='since' title='Stable since Rust version 1.6.0'>1.6.0</div><a class='srclink' href='../src/core/num/mod.rs.html#4838-4843' title='goto source code'>[src]</a></h3><div class='docblock'><p>Converts <code>f32</code> to <code>f64</code> losslessly.</p>
</div><div class='impl-items'><h4 id='method.from-5' class="method hidden"><code id='from.v-5'>fn <a href='../std/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(small: <a class="primitive" href="primitive.f32.html">f32</a>) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/core/num/mod.rs.html#4840-4842' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-From%3Cu8%3E' class='impl'><code class='in-band'>impl <a class="trait" href="../std/convert/trait.From.html" title="trait std::convert::From">From</a>&lt;<a class="primitive" href="primitive.u8.html">u8</a>&gt; for <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-From%3Cu8%3E' class='anchor'></a><div class='since' title='Stable since Rust version 1.6.0'>1.6.0</div><a class='srclink' href='../src/core/num/mod.rs.html#4838-4843' title='goto source code'>[src]</a></h3><div class='docblock'><p>Converts <code>u8</code> to <code>f64</code> losslessly.</p>
</div><div class='impl-items'><h4 id='method.from-6' class="method hidden"><code id='from.v-6'>fn <a href='../std/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(small: <a class="primitive" href="primitive.u8.html">u8</a>) -&gt; <a class="primitive" href="primitive.f64.html">f64</a></code><a class='srclink' href='../src/core/num/mod.rs.html#4840-4842' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="../std/marker/trait.Send.html" title="trait std::marker::Send">Send</a> for <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="../std/marker/trait.Sync.html" title="trait std::marker::Sync">Sync</a> for <a class="primitive" href="primitive.f64.html">f64</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-TryFrom' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="../std/convert/trait.TryFrom.html" title="trait std::convert::TryFrom">TryFrom</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="../std/convert/trait.Into.html" title="trait std::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-TryFrom' class='anchor'></a><a class='srclink' href='../src/core/convert.rs.html#565-571' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='../std/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="../std/convert/enum.Infallible.html" title="enum std::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='../std/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -&gt; <a class="enum" href="../std/result/enum.Result.html" title="enum std::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="../std/convert/trait.TryFrom.html" title="trait std::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="../std/convert/trait.TryFrom.html#associatedtype.Error" title="type std::convert::TryFrom::Error">Error</a>&gt;</code><a class='srclink' href='../src/core/convert.rs.html#568-570' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-From' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="../std/convert/trait.From.html" title="trait std::convert::From">From</a> for T</code><a href='#impl-From' class='anchor'></a><a class='srclink' href='../src/core/convert.rs.html#546-548' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-7' class="method hidden"><code id='from.v-7'>fn <a href='../std/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -&gt; T</code><a class='srclink' href='../src/core/convert.rs.html#547' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-TryInto' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="../std/convert/trait.TryInto.html" title="trait std::convert::TryInto">TryInto</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="../std/convert/trait.TryFrom.html" title="trait std::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-TryInto' class='anchor'></a><a class='srclink' href='../src/core/convert.rs.html#553-560' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='../std/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = &lt;U as <a class="trait" href="../std/convert/trait.TryFrom.html" title="trait std::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="../std/convert/trait.TryFrom.html#associatedtype.Error" title="type std::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='../std/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -&gt; <a class="enum" href="../std/result/enum.Result.html" title="enum std::result::Result">Result</a>&lt;U, &lt;U as <a class="trait" href="../std/convert/trait.TryFrom.html" title="trait std::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="../std/convert/trait.TryFrom.html#associatedtype.Error" title="type std::convert::TryFrom::Error">Error</a>&gt;</code><a class='srclink' href='../src/core/convert.rs.html#557-559' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-Into' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="../std/convert/trait.Into.html" title="trait std::convert::Into">Into</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="../std/convert/trait.From.html" title="trait std::convert::From">From</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-Into' class='anchor'></a><a class='srclink' href='../src/core/convert.rs.html#537-542' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='../std/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -&gt; U</code><a class='srclink' href='../src/core/convert.rs.html#539-541' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-Borrow' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="../std/borrow/trait.Borrow.html" title="trait std::borrow::Borrow">Borrow</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-Borrow' class='anchor'></a><a class='srclink' href='../src/core/borrow.rs.html#213-215' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="primitive" href="primitive.reference.html">&amp;'_ mut </a>F</span></div><div class="content hidden"><h3 class="important">Important traits for <a class="primitive" href="primitive.reference.html">&amp;'_ mut </a>F</h3><code class="content"><span class="where fmt-newline">impl&lt;'_, F&gt; <a class="trait" href="../std/future/trait.Future.html" title="trait std::future::Future">Future</a> for <a class="primitive" href="primitive.reference.html">&amp;'_ mut </a>F <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="../std/marker/trait.Unpin.html" title="trait std::marker::Unpin">Unpin</a> + <a class="trait" href="../std/future/trait.Future.html" title="trait std::future::Future">Future</a> + ?<a class="trait" href="../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></span><span class="where fmt-newline">    type <a href='../std/future/trait.Future.html#associatedtype.Output' class="type">Output</a> = &lt;F as <a class="trait" href="../std/future/trait.Future.html" title="trait std::future::Future">Future</a>&gt;::<a class="type" href="../std/future/trait.Future.html#associatedtype.Output" title="type std::future::Future::Output">Output</a>;</span><span class="where fmt-newline">impl&lt;'_, I&gt; <a class="trait" href="../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a> for <a class="primitive" href="primitive.reference.html">&amp;'_ mut </a>I <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;I: <a class="trait" href="../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a> + ?<a class="trait" href="../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></span><span class="where fmt-newline">    type <a href='../std/iter/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = &lt;I as <a class="trait" href="../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a>&gt;::<a class="type" href="../std/iter/trait.Iterator.html#associatedtype.Item" title="type std::iter::Iterator::Item">Item</a>;</span><span class="where fmt-newline">impl&lt;R:&nbsp;<a class="trait" href="../std/io/trait.Read.html" title="trait std::io::Read">Read</a> + ?<a class="trait" href="../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>, '_&gt; <a class="trait" href="../std/io/trait.Read.html" title="trait std::io::Read">Read</a> for <a class="primitive" href="primitive.reference.html">&amp;'_ mut </a>R</span><span class="where fmt-newline">impl&lt;W:&nbsp;<a class="trait" href="../std/io/trait.Write.html" title="trait std::io::Write">Write</a> + ?<a class="trait" href="../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>, '_&gt; <a class="trait" href="../std/io/trait.Write.html" title="trait std::io::Write">Write</a> for <a class="primitive" href="primitive.reference.html">&amp;'_ mut </a>W</span></code></div></div><code id='borrow.v'>fn <a href='../std/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&amp;self) -&gt; <a class="primitive" href="primitive.reference.html">&amp;</a>T</code><a class='srclink' href='../src/core/borrow.rs.html#214' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="../std/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div><h3 id='impl-BorrowMut' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="../std/borrow/trait.BorrowMut.html" title="trait std::borrow::BorrowMut">BorrowMut</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-BorrowMut' class='anchor'></a><a class='srclink' href='../src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="primitive" href="primitive.reference.html">&amp;'_ mut </a>F</span></div><div class="content hidden"><h3 class="important">Important traits for <a class="primitive" href="primitive.reference.html">&amp;'_ mut </a>F</h3><code class="content"><span class="where fmt-newline">impl&lt;'_, F&gt; <a class="trait" href="../std/future/trait.Future.html" title="trait std::future::Future">Future</a> for <a class="primitive" href="primitive.reference.html">&amp;'_ mut </a>F <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="../std/marker/trait.Unpin.html" title="trait std::marker::Unpin">Unpin</a> + <a class="trait" href="../std/future/trait.Future.html" title="trait std::future::Future">Future</a> + ?<a class="trait" href="../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></span><span class="where fmt-newline">    type <a href='../std/future/trait.Future.html#associatedtype.Output' class="type">Output</a> = &lt;F as <a class="trait" href="../std/future/trait.Future.html" title="trait std::future::Future">Future</a>&gt;::<a class="type" href="../std/future/trait.Future.html#associatedtype.Output" title="type std::future::Future::Output">Output</a>;</span><span class="where fmt-newline">impl&lt;'_, I&gt; <a class="trait" href="../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a> for <a class="primitive" href="primitive.reference.html">&amp;'_ mut </a>I <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;I: <a class="trait" href="../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a> + ?<a class="trait" href="../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></span><span class="where fmt-newline">    type <a href='../std/iter/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = &lt;I as <a class="trait" href="../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a>&gt;::<a class="type" href="../std/iter/trait.Iterator.html#associatedtype.Item" title="type std::iter::Iterator::Item">Item</a>;</span><span class="where fmt-newline">impl&lt;R:&nbsp;<a class="trait" href="../std/io/trait.Read.html" title="trait std::io::Read">Read</a> + ?<a class="trait" href="../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>, '_&gt; <a class="trait" href="../std/io/trait.Read.html" title="trait std::io::Read">Read</a> for <a class="primitive" href="primitive.reference.html">&amp;'_ mut </a>R</span><span class="where fmt-newline">impl&lt;W:&nbsp;<a class="trait" href="../std/io/trait.Write.html" title="trait std::io::Write">Write</a> + ?<a class="trait" href="../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>, '_&gt; <a class="trait" href="../std/io/trait.Write.html" title="trait std::io::Write">Write</a> for <a class="primitive" href="primitive.reference.html">&amp;'_ mut </a>W</span></code></div></div><code id='borrow_mut.v'>fn <a href='../std/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="primitive.reference.html">&amp;mut </a>T</code><a class='srclink' href='../src/core/borrow.rs.html#219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="../std/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></div><h3 id='impl-Any' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="../std/any/trait.Any.html" title="trait std::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='../src/core/any.rs.html#100-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='../std/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&amp;self) -&gt; <a class="struct" href="../std/any/struct.TypeId.html" title="struct std::any::TypeId">TypeId</a></code><a class='srclink' href='../src/core/any.rs.html#101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="../std/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="../std/borrow/trait.ToOwned.html" title="trait std::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../std/clone/trait.Clone.html" title="trait std::clone::Clone">Clone</a>,&nbsp;</span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='../src/alloc/borrow.rs.html#80-91' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='../std/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='../std/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&amp;self) -&gt; T</code><a class='srclink' href='../src/alloc/borrow.rs.html#84-86' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="../std/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
</div><h4 id='method.clone_into' class="method hidden"><code id='clone_into.v'>fn <a href='../std/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&amp;self, target: <a class="primitive" href="primitive.reference.html">&amp;mut </a>T)</code><a class='srclink' href='../src/alloc/borrow.rs.html#88-90' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>&nbsp;<a href="https://github.com/rust-lang/rust/issues/41263">#41263</a>)</summary><p>recently added</p>
</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="../std/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
</div></div><h3 id='impl-ToString' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="../std/string/trait.ToString.html" title="trait std::string::ToString">ToString</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../std/fmt/trait.Display.html" title="trait std::fmt::Display">Display</a> + ?<a class="trait" href="../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-ToString' class='anchor'></a><a class='srclink' href='../src/alloc/string.rs.html#2122-2132' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.to_string' class="method hidden"><code id='to_string.v'>default fn <a href='../std/string/trait.ToString.html#tymethod.to_string' class='fnname'>to_string</a>(&amp;self) -&gt; <a class="struct" href="../std/string/struct.String.html" title="struct std::string::String">String</a></code><a class='srclink' href='../src/alloc/string.rs.html#2124-2131' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Converts the given value to a <code>String</code>. <a href="../std/string/trait.ToString.html#tymethod.to_string">Read more</a></p>
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>&#9166;</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "std";</script><script src="../aliases.js"></script><script src="../main1.35.0.js"></script><script defer src="../search-index.js"></script></body></html>