Uh oh!
There was an error while loading. Please reload this page.
make exp_m1 and ln_1p examples more representative of use - #77099
Conversation
rust-highfive
commented
Sep 23, 2020
r? @sfackler (rust_highfive has picked a reviewer for you, use r? to override) |
With this commit, the examples for exp_m1 would fail if x.exp() - 1.0 is used instead of x.exp_m1().
With this commit, the examples for ln_1p would fail if (x + 1.0).ln() is used instead of x.ln_1p().
b51cc31 to
50d3ddcComparesfackler
commented
Sep 23, 2020
r? @rust-lang/docs |
steveklabnik
commented
Sep 23, 2020
Honestly, I never use these functions so I have no idea if this is an improvement or not. |
tspiteri
commented
Sep 23, 2020
As far as I know, both functions are there basically to provide more accuracy when the operand is close to zero, so my thinking was that the example should use an operand that is close to zero. And if someone tries to modify the examples to use the other ( |
Dylan-DPC-zz
commented
Oct 13, 2020
steveklabnik
commented
Oct 13, 2020
I still have not used these functions and so don't know if it's an improvement, so I shouldn't be the reviewer. |
m-ou-se
commented
Oct 30, 2020
Nice, those are much better examples for these functions.
Do you think it would be good to show that in the examples as well? |
tspiteri
commented
Oct 30, 2020
My concern is that maybe then the examples might become a bit too cluttered/daunting. At least I did not find a way to show this in the examples that satisfied me. |
m-ou-se
commented
Oct 30, 2020
Alright, makes sense. Thanks for the improvement. @bors r+ rollup |
bors
commented
Oct 30, 2020
📌 Commit 50d3ddc has been approved by |
make exp_m1 and ln_1p examples more representative of use With this PR, the examples for `exp_m1` would fail if `x.exp() - 1.0` is used instead of `x.exp_m1()`, and the examples for `ln_1p` would fail if `(x + 1.0).ln()` is used instead of `x.ln_1p()`.
make exp_m1 and ln_1p examples more representative of use With this PR, the examples for `exp_m1` would fail if `x.exp() - 1.0` is used instead of `x.exp_m1()`, and the examples for `ln_1p` would fail if `(x + 1.0).ln()` is used instead of `x.ln_1p()`.
make exp_m1 and ln_1p examples more representative of use With this PR, the examples for `exp_m1` would fail if `x.exp() - 1.0` is used instead of `x.exp_m1()`, and the examples for `ln_1p` would fail if `(x + 1.0).ln()` is used instead of `x.ln_1p()`.
Rollup of 7 pull requests Successful merges: - rust-lang#74622 (Add std::panic::panic_any.) - rust-lang#77099 (make exp_m1 and ln_1p examples more representative of use) - rust-lang#78526 (Strip tokens from trait and impl items before printing AST JSON) - rust-lang#78550 (x.py setup: Create config.toml in the current directory, not the top-level directory) - rust-lang#78577 (validator: Extend aliasing check to a call terminator) - rust-lang#78581 (Constantify more BTreeMap and BTreeSet functions) - rust-lang#78587 (parser: Cleanup `LazyTokenStream` and avoid some clones) Failed merges: r? `@ghost`
With this PR, the examples for
exp_m1would fail ifx.exp() - 1.0is used instead ofx.exp_m1(), and the examples forln_1pwould fail if(x + 1.0).ln()is used instead ofx.ln_1p().