-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Some std::f32 constants are actually f64s #11537
Comments
|
Unless I'm completely misunderstanding something, I think it is. Interestingly, the source references issue #1433, which doesn't seem related. |
Note: this issue and issue 13297 should be resolved together. |
aturon
added a commit
to aturon/rust
that referenced
this issue
Apr 23, 2014
Some of the constant values in std::f32 were incorrectly copied from std::f64. More broadly, both modules defined their constants redundantly in two places, which is what led to the bug. Moreover, the specs for some of the constants were incorrent, even when the values were correct. Closes rust-lang#13297. Closes rust-lang#11537.
bors
added a commit
that referenced
this issue
Apr 24, 2014
Some of the constant values in std::f32 were incorrectly copied from std::f64. More broadly, both modules defined their constants redundantly in two places, which is what led to the bug. Moreover, the specs for some of the constants were incorrect, even when the values were correct. Closes #13297. Closes #11537.
flip1995
pushed a commit
to flip1995/rust
that referenced
this issue
Dec 16, 2023
new lint: `repeat_vec_with_capacity` Closes rust-lang#11537 [Lint description](https://github.com/y21/rust-clippy/blob/repeat_vec_with_capacity/clippy_lints/src/repeat_vec_with_capacity.rs#L14) should explain this PR :) changelog: new lint: `repeat_vec_with_capacity`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
std::f32::MAX_VALUE
,std::f32::MIN_VALUE
, andstd::f32::EPSILON
are all actuallyf64
s, notf32
s as expected.FLT_MAX
andFLT_MIN
in C are allfloat
s, notdouble
s, for example. If this is intentional, it's very confusing to me why any constants in thestd::f32
module should bef64
s, and probably should be explained in the documentation.The text was updated successfully, but these errors were encountered: