Skip to content
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

No documentation about f32_runtime without std #63905

Open
elichai opened this issue Aug 25, 2019 · 2 comments
Open

No documentation about f32_runtime without std #63905

elichai opened this issue Aug 25, 2019 · 2 comments
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools A-floating-point Area: Floating point numbers and arithmetic C-enhancement Category: An issue proposing an enhancement or a PR with one. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@elichai
Copy link
Contributor

elichai commented Aug 25, 2019

Hi,
It seems like all the functions under f32_runtime don't work without std (https://doc.rust-lang.org/src/std/f32.rs.html#29-994)
I tried looking for documentation about this and didn't find anything concrete, and since the core docs don't have documentation for the primitives and only the std ones do it's hard to figure this out.
Some examples:
https://play.rust-lang.org/?gist=5aa47f506cd792cf58fbcd9f0219ef2b

According to: #39473
It sounds like some of it may be on purpose? if so it's too bad but at least should be documented well

@jonas-schievink jonas-schievink added C-enhancement Category: An issue proposing an enhancement or a PR with one. A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools labels Aug 25, 2019
@elichai
Copy link
Contributor Author

elichai commented Aug 26, 2019

This can be a real problem.

i.e. if you need to calc 2^-36 you can do (-36f32).exp2().
Without access to this you might think you can just do:
let a: f32 = 1.0 / 2u32.pow(36) as f32
But this will overflow.

Is there any solution to this?

@varkor
Copy link
Member

varkor commented Aug 27, 2019

The tracking issue for this is #50145. @Lokathor's been making good progress recently towards addressing this problem in #63455. (So it's possible that soon enough, extra documentation won't be necessary.)

@jonas-schievink jonas-schievink added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Mar 6, 2020
@jonas-schievink jonas-schievink added the A-floating-point Area: Floating point numbers and arithmetic label Jul 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools A-floating-point Area: Floating point numbers and arithmetic C-enhancement Category: An issue proposing an enhancement or a PR with one. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants