-
Notifications
You must be signed in to change notification settings - Fork 13.3k
RFC: Removing `float' #6592
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I was talking to @brson a while back on IRC about this. I think he had a reason to keep it, but I can't remember what it was. All I know is that |
I think |
As far as I know there reason for a separate So, for example on a machine that has fast native The reason it's a separate type and not a typedef is the same as for |
So why are we using Is there really an architecture where a double is faster? |
@Kimundi That doesn't make any sense though, as changing floating-point format under the feet of a program will more than likely break it in much more complex ways than the size_t-alikes int/uint. OpenGL ES for example does this, and gets http://youilabs.com/blog/mobile-gpu-floating-point-accuracy-variances/ as a result. (Note that the conclusion in that blog post is slightly wrong though) |
@cmr I believe that writing simply |
in theory "float" should be f80 on x86, as that's fastest... |
@cscott: only with the legacy x87 support though |
Nominating for milestone 1, well-defined |
Accepted for well-defined |
@catamorphism: Does this mean we decided to remove float as a different type from f64? Should I write a patch to do it? |
I think there's consensus that it's useless as implemented right now. If it's supposed to be the fastest type for the platform, it should be |
I don't agree with @thestinger that highest precision possible with a native floating point type is bad. But I think removing Once removed, the question then becomes what type |
I'll implement this by removing |
You're the bestest. <3 @thestinger. |
It is simply defined as `f64` across every platform right now. A use case hasn't been presented for a `float` type defined as the highest precision floating point type implemented in hardware on the platform. Performance-wise, using the smallest precision correct for the use case greatly saves on cache space and allows for fitting more numbers into SSE/AVX registers. If there was a use case, this could be implemented as simply a type alias or a struct thanks to `#[cfg(...)]`. Closes #6592 The mailing list thread, for reference: https://mail.mozilla.org/pipermail/rust-dev/2013-July/004632.html
float
andf64
are not currently the same type in Rust.We discussed it on IRC and couldn't think of a good reason to have them separated, and some reasons to have only one type (with a possible typedef to keep both names).
The pros of mergeing the types include
The text was updated successfully, but these errors were encountered: