LibrEDA project web page. https://libreda.codeberg.page
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

77 lines
34 KiB

<!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="Provides methods to compute an integer’s square root, cube root, and arbitrary `n`th root."><meta name="keywords" content="rust, rustlang, rust-lang, Roots"><title>Roots in num_integer - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../num_integer/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><h2 class="location">Trait Roots</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><div class="sidebar-links"><a href="#tymethod.nth_root">nth_root</a></div><h3 class="sidebar-title"><a href="#provided-methods">Provided Methods</a></h3><div class="sidebar-links"><a href="#method.cbrt">cbrt</a><a href="#method.sqrt">sqrt</a></div><h3 class="sidebar-title"><a href="#foreign-impls">Implementations on Foreign Types</a></h3><div class="sidebar-links"><a href="#impl-Roots-for-i128">i128</a><a href="#impl-Roots-for-i16">i16</a><a href="#impl-Roots-for-i32">i32</a><a href="#impl-Roots-for-i64">i64</a><a href="#impl-Roots-for-i8">i8</a><a href="#impl-Roots-for-isize">isize</a><a href="#impl-Roots-for-u128">u128</a><a href="#impl-Roots-for-u16">u16</a><a href="#impl-Roots-for-u32">u32</a><a href="#impl-Roots-for-u64">u64</a><a href="#impl-Roots-for-u8">u8</a><a href="#impl-Roots-for-usize">usize</a></div><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div><h2 class="location">Other items in<br><a href="index.html">num_integer</a></h2><div id="sidebar-vars" data-name="Roots" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Trait <a href="index.html">num_integer</a>::<wbr><a class="trait" href="#">Roots</a><button id="copy-path" onclick="copy_path(this)" title="copy path"><img src="../clipboard.svg" width="19" height="18" alt="Copy item import" title="Copy item import to clipboard"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/num_integer/roots.rs.html#9-111" title="goto source code">[src]</a></span></h1><div class="docblock type-decl"><pre class="rust trait">pub trait Roots: <a class="trait" href="trait.Integer.html" title="trait num_integer::Integer">Integer</a> {
fn <a href="#tymethod.nth_root" class="fnname">nth_root</a>(&amp;self, n: <a class="primitive" href="https://doc.rust-lang.org/1.54.0/std/primitive.u32.html">u32</a>) -&gt; Self;
fn <a href="#method.sqrt" class="fnname">sqrt</a>(&amp;self) -&gt; Self { ... }
<div class="item-spacer"></div> fn <a href="#method.cbrt" class="fnname">cbrt</a>(&amp;self) -&gt; Self { ... }
}</pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Provides methods to compute an integer’s square root, cube root,
and arbitrary <code>n</code>th root.</p>
</div></details><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="tymethod.nth_root" class="method has-srclink"><h4 class="code-header">fn <a href="#tymethod.nth_root" class="fnname">nth_root</a>(&amp;self, n: <a class="primitive" href="https://doc.rust-lang.org/1.54.0/std/primitive.u32.html">u32</a>) -&gt; Self</h4><a class="srclink" href="../src/num_integer/roots.rs.html#55" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Returns the truncated principal <code>n</code>th root of an integer
<code>if x &gt;= 0 { ⌊ⁿ√x⌋ } else { ⌈ⁿ√x⌉ }</code></p>
<p>This is solving for <code>r</code> in <code>rⁿ = x</code>, rounding toward zero.
If <code>x</code> is positive, the result will satisfy <code>rⁿ ≤ x &lt; (r+1)ⁿ</code>.
If <code>x</code> is negative and <code>n</code> is odd, then <code>(r-1)ⁿ &lt; x ≤ rⁿ</code>.</p>
<h1 id="panics" class="section-header"><a href="#panics">Panics</a></h1>
<p>Panics if <code>n</code> is zero:</p>
<div class='information'><div class='tooltip should_panic'></div></div><div class="example-wrap"><pre class="rust rust-example-rendered should_panic">
<span class="macro">println!</span>(<span class="string">&quot;can&#39;t compute ⁰√x : {}&quot;</span>, <span class="number">123</span>.<span class="ident">nth_root</span>(<span class="number">0</span>));</pre></div>
<p>or if <code>n</code> is even and <code>self</code> is negative:</p>
<div class='information'><div class='tooltip should_panic'></div></div><div class="example-wrap"><pre class="rust rust-example-rendered should_panic">
<span class="macro">println!</span>(<span class="string">&quot;no imaginary numbers... {}&quot;</span>, (<span class="op">-</span><span class="number">1</span>).<span class="ident">nth_root</span>(<span class="number">10</span>));</pre></div>
<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">use</span> <span class="ident">num_integer::Roots</span>;
<span class="kw">let</span> <span class="ident">x</span>: <span class="ident">i32</span> <span class="op">=</span> <span class="number">12345</span>;
<span class="macro">assert_eq!</span>(<span class="ident">x</span>.<span class="ident">nth_root</span>(<span class="number">1</span>), <span class="ident">x</span>);
<span class="macro">assert_eq!</span>(<span class="ident">x</span>.<span class="ident">nth_root</span>(<span class="number">2</span>), <span class="ident">x</span>.<span class="ident">sqrt</span>());
<span class="macro">assert_eq!</span>(<span class="ident">x</span>.<span class="ident">nth_root</span>(<span class="number">3</span>), <span class="ident">x</span>.<span class="ident">cbrt</span>());
<span class="macro">assert_eq!</span>(<span class="ident">x</span>.<span class="ident">nth_root</span>(<span class="number">4</span>), <span class="number">10</span>);
<span class="macro">assert_eq!</span>(<span class="ident">x</span>.<span class="ident">nth_root</span>(<span class="number">13</span>), <span class="number">2</span>);
<span class="macro">assert_eq!</span>(<span class="ident">x</span>.<span class="ident">nth_root</span>(<span class="number">14</span>), <span class="number">1</span>);
<span class="macro">assert_eq!</span>(<span class="ident">x</span>.<span class="ident">nth_root</span>(<span class="ident">std::u32::MAX</span>), <span class="number">1</span>);
<span class="macro">assert_eq!</span>(<span class="ident">std::i32::MAX</span>.<span class="ident">nth_root</span>(<span class="number">30</span>), <span class="number">2</span>);
<span class="macro">assert_eq!</span>(<span class="ident">std::i32::MAX</span>.<span class="ident">nth_root</span>(<span class="number">31</span>), <span class="number">1</span>);
<span class="macro">assert_eq!</span>(<span class="ident">std::i32::MIN</span>.<span class="ident">nth_root</span>(<span class="number">31</span>), <span class="op">-</span><span class="number">2</span>);
<span class="macro">assert_eq!</span>((<span class="ident">std::i32::MIN</span> <span class="op">+</span> <span class="number">1</span>).<span class="ident">nth_root</span>(<span class="number">31</span>), <span class="op">-</span><span class="number">1</span>);
<span class="macro">assert_eq!</span>(<span class="ident">std::u32::MAX</span>.<span class="ident">nth_root</span>(<span class="number">31</span>), <span class="number">2</span>);
<span class="macro">assert_eq!</span>(<span class="ident">std::u32::MAX</span>.<span class="ident">nth_root</span>(<span class="number">32</span>), <span class="number">1</span>);</pre></div>
</div></details></div><h2 id="provided-methods" class="small-section-header">Provided methods<a href="#provided-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="method.sqrt" class="method has-srclink"><h4 class="code-header">fn <a href="#method.sqrt" class="fnname">sqrt</a>(&amp;self) -&gt; Self</h4><a class="srclink" href="../src/num_integer/roots.rs.html#82-84" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Returns the truncated principal square root of an integer – <code>⌊√x⌋</code></p>
<p>This is solving for <code>r</code> in <code>r² = x</code>, rounding toward zero.
The result will satisfy <code>r² ≤ x &lt; (r+1)²</code>.</p>
<h1 id="panics-1" class="section-header"><a href="#panics-1">Panics</a></h1>
<p>Panics if <code>self</code> is less than zero:</p>
<div class='information'><div class='tooltip should_panic'></div></div><div class="example-wrap"><pre class="rust rust-example-rendered should_panic">
<span class="macro">println!</span>(<span class="string">&quot;no imaginary numbers... {}&quot;</span>, (<span class="op">-</span><span class="number">1</span>).<span class="ident">sqrt</span>());</pre></div>
<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">use</span> <span class="ident">num_integer::Roots</span>;
<span class="kw">let</span> <span class="ident">x</span>: <span class="ident">i32</span> <span class="op">=</span> <span class="number">12345</span>;
<span class="macro">assert_eq!</span>((<span class="ident">x</span> <span class="op">*</span> <span class="ident">x</span>).<span class="ident">sqrt</span>(), <span class="ident">x</span>);
<span class="macro">assert_eq!</span>((<span class="ident">x</span> <span class="op">*</span> <span class="ident">x</span> <span class="op">+</span> <span class="number">1</span>).<span class="ident">sqrt</span>(), <span class="ident">x</span>);
<span class="macro">assert_eq!</span>((<span class="ident">x</span> <span class="op">*</span> <span class="ident">x</span> <span class="op">-</span> <span class="number">1</span>).<span class="ident">sqrt</span>(), <span class="ident">x</span> <span class="op">-</span> <span class="number">1</span>);</pre></div>
</div></details><details class="rustdoc-toggle" open><summary><div id="method.cbrt" class="method has-srclink"><h4 class="code-header">fn <a href="#method.cbrt" class="fnname">cbrt</a>(&amp;self) -&gt; Self</h4><a class="srclink" href="../src/num_integer/roots.rs.html#108-110" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Returns the truncated principal cube root of an integer –
<code>if x &gt;= 0 { ⌊∛x⌋ } else { ⌈∛x⌉ }</code></p>
<p>This is solving for <code>r</code> in <code>r³ = x</code>, rounding toward zero.
If <code>x</code> is positive, the result will satisfy <code>r³ ≤ x &lt; (r+1)³</code>.
If <code>x</code> is negative, then <code>(r-1)³ &lt; x ≤ r³</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">use</span> <span class="ident">num_integer::Roots</span>;
<span class="kw">let</span> <span class="ident">x</span>: <span class="ident">i32</span> <span class="op">=</span> <span class="number">1234</span>;
<span class="macro">assert_eq!</span>((<span class="ident">x</span> <span class="op">*</span> <span class="ident">x</span> <span class="op">*</span> <span class="ident">x</span>).<span class="ident">cbrt</span>(), <span class="ident">x</span>);
<span class="macro">assert_eq!</span>((<span class="ident">x</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="number">1</span>).<span class="ident">cbrt</span>(), <span class="ident">x</span>);
<span class="macro">assert_eq!</span>((<span class="ident">x</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="number">1</span>).<span class="ident">cbrt</span>(), <span class="ident">x</span> <span class="op">-</span> <span class="number">1</span>);
<span class="macro">assert_eq!</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">x</span>)).<span class="ident">cbrt</span>(), <span class="op">-</span><span class="ident">x</span>);
<span class="macro">assert_eq!</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">x</span> <span class="op">+</span> <span class="number">1</span>)).<span class="ident">cbrt</span>(), <span class="op">-</span><span class="ident">x</span>);
<span class="macro">assert_eq!</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">x</span> <span class="op">-</span> <span class="number">1</span>)).<span class="ident">cbrt</span>(), <span class="op">-</span>(<span class="ident">x</span> <span class="op">-</span> <span class="number">1</span>));</pre></div>
</div></details></div><h2 id="foreign-impls" class="small-section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Roots-for-i8" class="impl has-srclink"><h3 class="code-header in-band">impl <a class="trait" href="trait.Roots.html" title="trait num_integer::Roots">Roots</a> for <a class="primitive" href="https://doc.rust-lang.org/1.54.0/std/primitive.i8.html">i8</a></h3><a href="#impl-Roots-for-i8" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#165" title="goto source code">[src]</a></div></summary><div class="impl-items"><div id="method.nth_root" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="#tymethod.nth_root" class="fnname">nth_root</a>(&amp;self, n: <a class="primitive" href="https://doc.rust-lang.org/1.54.0/std/primitive.u32.html">u32</a>) -&gt; Self</h4><a href="#method.nth_root" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#165" title="goto source code">[src]</a></div><div id="method.sqrt-1" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="#method.sqrt" class="fnname">sqrt</a>(&amp;self) -&gt; Self</h4><a href="#method.sqrt-1" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#165" title="goto source code">[src]</a></div><div id="method.cbrt-1" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="#method.cbrt" class="fnname">cbrt</a>(&amp;self) -&gt; Self</h4><a href="#method.cbrt-1" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#165" title="goto source code">[src]</a></div></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Roots-for-i16" class="impl has-srclink"><h3 class="code-header in-band">impl <a class="trait" href="trait.Roots.html" title="trait num_integer::Roots">Roots</a> for <a class="primitive" href="https://doc.rust-lang.org/1.54.0/std/primitive.i16.html">i16</a></h3><a href="#impl-Roots-for-i16" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#166" title="goto source code">[src]</a></div></summary><div class="impl-items"><div id="method.nth_root-1" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="#tymethod.nth_root" class="fnname">nth_root</a>(&amp;self, n: <a class="primitive" href="https://doc.rust-lang.org/1.54.0/std/primitive.u32.html">u32</a>) -&gt; Self</h4><a href="#method.nth_root-1" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#166" title="goto source code">[src]</a></div><div id="method.sqrt-2" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="#method.sqrt" class="fnname">sqrt</a>(&amp;self) -&gt; Self</h4><a href="#method.sqrt-2" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#166" title="goto source code">[src]</a></div><div id="method.cbrt-2" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="#method.cbrt" class="fnname">cbrt</a>(&amp;self) -&gt; Self</h4><a href="#method.cbrt-2" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#166" title="goto source code">[src]</a></div></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Roots-for-i32" class="impl has-srclink"><h3 class="code-header in-band">impl <a class="trait" href="trait.Roots.html" title="trait num_integer::Roots">Roots</a> for <a class="primitive" href="https://doc.rust-lang.org/1.54.0/std/primitive.i32.html">i32</a></h3><a href="#impl-Roots-for-i32" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#167" title="goto source code">[src]</a></div></summary><div class="impl-items"><div id="method.nth_root-2" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="#tymethod.nth_root" class="fnname">nth_root</a>(&amp;self, n: <a class="primitive" href="https://doc.rust-lang.org/1.54.0/std/primitive.u32.html">u32</a>) -&gt; Self</h4><a href="#method.nth_root-2" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#167" title="goto source code">[src]</a></div><div id="method.sqrt-3" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="#method.sqrt" class="fnname">sqrt</a>(&amp;self) -&gt; Self</h4><a href="#method.sqrt-3" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#167" title="goto source code">[src]</a></div><div id="method.cbrt-3" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="#method.cbrt" class="fnname">cbrt</a>(&amp;self) -&gt; Self</h4><a href="#method.cbrt-3" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#167" title="goto source code">[src]</a></div></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Roots-for-i64" class="impl has-srclink"><h3 class="code-header in-band">impl <a class="trait" href="trait.Roots.html" title="trait num_integer::Roots">Roots</a> for <a class="primitive" href="https://doc.rust-lang.org/1.54.0/std/primitive.i64.html">i64</a></h3><a href="#impl-Roots-for-i64" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#168" title="goto source code">[src]</a></div></summary><div class="impl-items"><div id="method.nth_root-3" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="#tymethod.nth_root" class="fnname">nth_root</a>(&amp;self, n: <a class="primitive" href="https://doc.rust-lang.org/1.54.0/std/primitive.u32.html">u32</a>) -&gt; Self</h4><a href="#method.nth_root-3" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#168" title="goto source code">[src]</a></div><div id="method.sqrt-4" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="#method.sqrt" class="fnname">sqrt</a>(&amp;self) -&gt; Self</h4><a href="#method.sqrt-4" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#168" title="goto source code">[src]</a></div><div id="method.cbrt-4" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="#method.cbrt" class="fnname">cbrt</a>(&amp;self) -&gt; Self</h4><a href="#method.cbrt-4" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#168" title="goto source code">[src]</a></div></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Roots-for-i128" class="impl has-srclink"><h3 class="code-header in-band">impl <a class="trait" href="trait.Roots.html" title="trait num_integer::Roots">Roots</a> for <a class="primitive" href="https://doc.rust-lang.org/1.54.0/std/primitive.i128.html">i128</a></h3><a href="#impl-Roots-for-i128" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#170" title="goto source code">[src]</a></div></summary><div class="impl-items"><div id="method.nth_root-4" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="#tymethod.nth_root" class="fnname">nth_root</a>(&amp;self, n: <a class="primitive" href="https://doc.rust-lang.org/1.54.0/std/primitive.u32.html">u32</a>) -&gt; Self</h4><a href="#method.nth_root-4" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#170" title="goto source code">[src]</a></div><div id="method.sqrt-5" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="#method.sqrt" class="fnname">sqrt</a>(&amp;self) -&gt; Self</h4><a href="#method.sqrt-5" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#170" title="goto source code">[src]</a></div><div id="method.cbrt-5" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="#method.cbrt" class="fnname">cbrt</a>(&amp;self) -&gt; Self</h4><a href="#method.cbrt-5" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#170" title="goto source code">[src]</a></div></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Roots-for-isize" class="impl has-srclink"><h3 class="code-header in-band">impl <a class="trait" href="trait.Roots.html" title="trait num_integer::Roots">Roots</a> for <a class="primitive" href="https://doc.rust-lang.org/1.54.0/std/primitive.isize.html">isize</a></h3><a href="#impl-Roots-for-isize" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#171" title="goto source code">[src]</a></div></summary><div class="impl-items"><div id="method.nth_root-5" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="#tymethod.nth_root" class="fnname">nth_root</a>(&amp;self, n: <a class="primitive" href="https://doc.rust-lang.org/1.54.0/std/primitive.u32.html">u32</a>) -&gt; Self</h4><a href="#method.nth_root-5" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#171" title="goto source code">[src]</a></div><div id="method.sqrt-6" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="#method.sqrt" class="fnname">sqrt</a>(&amp;self) -&gt; Self</h4><a href="#method.sqrt-6" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#171" title="goto source code">[src]</a></div><div id="method.cbrt-6" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="#method.cbrt" class="fnname">cbrt</a>(&amp;self) -&gt; Self</h4><a href="#method.cbrt-6" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#171" title="goto source code">[src]</a></div></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Roots-for-u8" class="impl has-srclink"><h3 class="code-header in-band">impl <a class="trait" href="trait.Roots.html" title="trait num_integer::Roots">Roots</a> for <a class="primitive" href="https://doc.rust-lang.org/1.54.0/std/primitive.u8.html">u8</a></h3><a href="#impl-Roots-for-u8" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#385" title="goto source code">[src]</a></div></summary><div class="impl-items"><div id="method.nth_root-6" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="#tymethod.nth_root" class="fnname">nth_root</a>(&amp;self, n: <a class="primitive" href="https://doc.rust-lang.org/1.54.0/std/primitive.u32.html">u32</a>) -&gt; Self</h4><a href="#method.nth_root-6" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#385" title="goto source code">[src]</a></div><div id="method.sqrt-7" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="#method.sqrt" class="fnname">sqrt</a>(&amp;self) -&gt; Self</h4><a href="#method.sqrt-7" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#385" title="goto source code">[src]</a></div><div id="method.cbrt-7" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="#method.cbrt" class="fnname">cbrt</a>(&amp;self) -&gt; Self</h4><a href="#method.cbrt-7" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#385" title="goto source code">[src]</a></div></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Roots-for-u16" class="impl has-srclink"><h3 class="code-header in-band">impl <a class="trait" href="trait.Roots.html" title="trait num_integer::Roots">Roots</a> for <a class="primitive" href="https://doc.rust-lang.org/1.54.0/std/primitive.u16.html">u16</a></h3><a href="#impl-Roots-for-u16" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#386" title="goto source code">[src]</a></div></summary><div class="impl-items"><div id="method.nth_root-7" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="#tymethod.nth_root" class="fnname">nth_root</a>(&amp;self, n: <a class="primitive" href="https://doc.rust-lang.org/1.54.0/std/primitive.u32.html">u32</a>) -&gt; Self</h4><a href="#method.nth_root-7" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#386" title="goto source code">[src]</a></div><div id="method.sqrt-8" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="#method.sqrt" class="fnname">sqrt</a>(&amp;self) -&gt; Self</h4><a href="#method.sqrt-8" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#386" title="goto source code">[src]</a></div><div id="method.cbrt-8" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="#method.cbrt" class="fnname">cbrt</a>(&amp;self) -&gt; Self</h4><a href="#method.cbrt-8" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#386" title="goto source code">[src]</a></div></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Roots-for-u32" class="impl has-srclink"><h3 class="code-header in-band">impl <a class="trait" href="trait.Roots.html" title="trait num_integer::Roots">Roots</a> for <a class="primitive" href="https://doc.rust-lang.org/1.54.0/std/primitive.u32.html">u32</a></h3><a href="#impl-Roots-for-u32" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#387" title="goto source code">[src]</a></div></summary><div class="impl-items"><div id="method.nth_root-8" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="#tymethod.nth_root" class="fnname">nth_root</a>(&amp;self, n: <a class="primitive" href="https://doc.rust-lang.org/1.54.0/std/primitive.u32.html">u32</a>) -&gt; Self</h4><a href="#method.nth_root-8" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#387" title="goto source code">[src]</a></div><div id="method.sqrt-9" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="#method.sqrt" class="fnname">sqrt</a>(&amp;self) -&gt; Self</h4><a href="#method.sqrt-9" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#387" title="goto source code">[src]</a></div><div id="method.cbrt-9" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="#method.cbrt" class="fnname">cbrt</a>(&amp;self) -&gt; Self</h4><a href="#method.cbrt-9" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#387" title="goto source code">[src]</a></div></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Roots-for-u64" class="impl has-srclink"><h3 class="code-header in-band">impl <a class="trait" href="trait.Roots.html" title="trait num_integer::Roots">Roots</a> for <a class="primitive" href="https://doc.rust-lang.org/1.54.0/std/primitive.u64.html">u64</a></h3><a href="#impl-Roots-for-u64" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#388" title="goto source code">[src]</a></div></summary><div class="impl-items"><div id="method.nth_root-9" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="#tymethod.nth_root" class="fnname">nth_root</a>(&amp;self, n: <a class="primitive" href="https://doc.rust-lang.org/1.54.0/std/primitive.u32.html">u32</a>) -&gt; Self</h4><a href="#method.nth_root-9" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#388" title="goto source code">[src]</a></div><div id="method.sqrt-10" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="#method.sqrt" class="fnname">sqrt</a>(&amp;self) -&gt; Self</h4><a href="#method.sqrt-10" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#388" title="goto source code">[src]</a></div><div id="method.cbrt-10" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="#method.cbrt" class="fnname">cbrt</a>(&amp;self) -&gt; Self</h4><a href="#method.cbrt-10" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#388" title="goto source code">[src]</a></div></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Roots-for-u128" class="impl has-srclink"><h3 class="code-header in-band">impl <a class="trait" href="trait.Roots.html" title="trait num_integer::Roots">Roots</a> for <a class="primitive" href="https://doc.rust-lang.org/1.54.0/std/primitive.u128.html">u128</a></h3><a href="#impl-Roots-for-u128" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#390" title="goto source code">[src]</a></div></summary><div class="impl-items"><div id="method.nth_root-10" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="#tymethod.nth_root" class="fnname">nth_root</a>(&amp;self, n: <a class="primitive" href="https://doc.rust-lang.org/1.54.0/std/primitive.u32.html">u32</a>) -&gt; Self</h4><a href="#method.nth_root-10" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#390" title="goto source code">[src]</a></div><div id="method.sqrt-11" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="#method.sqrt" class="fnname">sqrt</a>(&amp;self) -&gt; Self</h4><a href="#method.sqrt-11" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#390" title="goto source code">[src]</a></div><div id="method.cbrt-11" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="#method.cbrt" class="fnname">cbrt</a>(&amp;self) -&gt; Self</h4><a href="#method.cbrt-11" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#390" title="goto source code">[src]</a></div></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Roots-for-usize" class="impl has-srclink"><h3 class="code-header in-band">impl <a class="trait" href="trait.Roots.html" title="trait num_integer::Roots">Roots</a> for <a class="primitive" href="https://doc.rust-lang.org/1.54.0/std/primitive.usize.html">usize</a></h3><a href="#impl-Roots-for-usize" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#391" title="goto source code">[src]</a></div></summary><div class="impl-items"><div id="method.nth_root-11" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="#tymethod.nth_root" class="fnname">nth_root</a>(&amp;self, n: <a class="primitive" href="https://doc.rust-lang.org/1.54.0/std/primitive.u32.html">u32</a>) -&gt; Self</h4><a href="#method.nth_root-11" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#391" title="goto source code">[src]</a></div><div id="method.sqrt-12" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="#method.sqrt" class="fnname">sqrt</a>(&amp;self) -&gt; Self</h4><a href="#method.sqrt-12" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#391" title="goto source code">[src]</a></div><div id="method.cbrt-12" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="#method.cbrt" class="fnname">cbrt</a>(&amp;self) -&gt; Self</h4><a href="#method.cbrt-12" class="anchor"></a><a class="srclink" href="../src/num_integer/roots.rs.html#391" title="goto source code">[src]</a></div></div></details><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"></div><script type="text/javascript" src="../implementors/num_integer/trait.Roots.js" async></script></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="num_integer" data-search-index-js="../search-index.js" data-search-js="../search.js"></div><script src="../main.js"></script></body></html>