Uh oh!
There was an error while loading. Please reload this page.
Give float some examples - #22030
Conversation
rust-highfive
commented
Feb 7, 2015
r? @huonw (rust_highfive has picked a reviewer for you, use r? to override) |
mdinger
commented
Feb 7, 2015
There was a problem hiding this comment.
I think this should be Returns NaN. (with an s and a ‘.’)—the indicative style is recommended over the imperative.
(Same thing for the others below.)
There was a problem hiding this comment.
Previously didn't specify exponents base (2? 10? 7? e?). I had to figure out which one worked to recover the original number.
nagisa
commented
Feb 7, 2015
You could document the trait itself rather than this specific implementation of it, no? |
mdinger
commented
Feb 7, 2015
I don't mind documenting the trait. I was thinking there weren't any examples of traits being documented directly: |
11cf2bc to
cd2c941Comparemdinger
commented
Feb 9, 2015
Examples shouldn't break if you add a sign somewhere so prefer assigning to variables before using them: // Should preferlet f = 2.0f64;
f.powi(2);// over2.0f64.powi(2);// because
-2.0f64.powi(2);// gets parsed as
-(2.0f64.powi(2));// when the desired is(-2.0f64).powi(2);// but this works properlylet f = -2.0f64;
f.powi(2);Note: #22105 ran into this. |
steveklabnik
commented
Feb 10, 2015
Yes, we usually document the trait, not the specific implementation. This seems good though, thanks! would you mind squashing? r=me after |
mdinger
commented
Feb 10, 2015
Got a few left but sure. |
steveklabnik
commented
Feb 10, 2015
Do you want me to just wait until you've got more? I assumed this was ready, if not, I'm happy to hold off. |
mdinger
commented
Feb 10, 2015
Yeah. I've got another commit incoming. I'll squash after. I got most everything, maybe skipping deprecated and possibly a few unstable. I'll change the title from WIP when it's ready. |
steveklabnik
commented
Feb 10, 2015
Cool, thank you |
mdinger
commented
Feb 10, 2015
@steveklabnik This depends on #22076 merging. It won't pass |
There was a problem hiding this comment.
How a float is encoded needs a good reference. This link is probably wrong and is mainly so I remember. Reposting so it's not hidden.
There was a problem hiding this comment.
Deferred to #22152 . Just referred to the float section of the reference for now.
mdinger
commented
Feb 10, 2015
@steveklabnik Seems pretty good. Needs #22076 though so gotta wait until that lands. I'll do r= after that merges and |
steveklabnik
commented
Feb 16, 2015
steveklabnik
commented
Feb 16, 2015
no rollup as this is a big diff |
bors
commented
Feb 17, 2015
⌛ Testing commit 1a133f3 with merge b603823... |
Some examples for `std::num::Float` ~~This is WIP for making examples for `f32`. This probably won't pass `make tidy` and I'm not sure which `f32` needs documentation. rust-lang#22025 shows 2 sets of `f32` which seems split between `core` and `std`. I'm not sure which should be documented but I started doing a couple from `std`. Easy to move if that's where they go...~~ ~~Gotta build it eventually to actually see if the docs actually appear where I think they will or if I'm just disillusioned.~~ cc @steveklabnik
bors
commented
Feb 17, 2015
💔 Test failed - auto-win-32-nopt-t |
alexcrichton
commented
Feb 17, 2015
@bors: retry |
bors
commented
Feb 18, 2015
⌛ Testing commit 1a133f3 with merge 4087e5b... |
bors
commented
Feb 18, 2015
💔 Test failed - auto-win-32-nopt-t |
alexcrichton
commented
Feb 18, 2015
@bors: retry |
bors
commented
Feb 18, 2015
⌛ Testing commit 1a133f3 with merge 886aca4... |
bors
commented
Feb 18, 2015
💔 Test failed - auto-win-64-nopt-t |
alexcrichton
commented
Feb 18, 2015
@bors: retry |
bors
commented
Feb 18, 2015
⌛ Testing commit 1a133f3 with merge c34229c... |
bors
commented
Feb 18, 2015
💔 Test failed - auto-linux-64-nopt-t |
alexcrichton
commented
Feb 18, 2015
@bors: retry |
bors
commented
Feb 18, 2015
⌛ Testing commit 1a133f3 with merge 4b92061... |
bors
commented
Feb 18, 2015
💔 Test failed - auto-linux-64-x-android-t |
alexcrichton
commented
Feb 18, 2015
@bors: retry |
bors
commented
Feb 18, 2015
⌛ Testing commit 1a133f3 with merge 77988b5... |
bors
commented
Feb 18, 2015
💔 Test failed - auto-linux-64-opt |
fix: MIR evaluation of sized &T with recursive const fn
Some examples for
std::num::FloatThis is WIP for making examples forf32. This probably won't passmake tidyand I'm not sure whichf32needs documentation. #22025 shows 2 sets off32which seems split betweencoreandstd. I'm not sure which should be documented but I started doing a couple fromstd. Easy to move if that's where they go...Gotta build it eventually to actually see if the docs actually appear where I think they will or if I'm just disillusioned.cc @steveklabnik