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

Math.f32round alias? #10

Open
zloirock opened this issue Sep 24, 2023 · 3 comments
Open

Math.f32round alias? #10

zloirock opened this issue Sep 24, 2023 · 3 comments

Comments

@zloirock
Copy link

zloirock commented Sep 24, 2023

It's strange to have Math.f16round for Float16 and Math.fround for Float32 in terms of naming.

Maybe makes sense to add Math.f32round alias for consistency?

@bakkot
Copy link
Collaborator

bakkot commented Sep 24, 2023

I don't think it's that weird. In C++ (for example) "float" means binary32 floats, and "__fp16" means binary16.

Very few people need this, and those that do are likely to understand the distinction, so I don't think it's worth having an alias. I'll leave this open so others can chime in, but I doubt we'll do this.

@zloirock
Copy link
Author

It's JS, not C++, and the base number type is number -> float64, so there by the name "float" I see float64. Clarification is required, rather, for float32 that's used much less often.

@annevk
Copy link
Member

annevk commented Sep 25, 2023

I agree with @bakkot. This can always be added once there's a clear need established for it through Stack Overflow questions or libraries offering a wrapper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants