Skip to content

Conversation

@MultisampledNight
Copy link
Contributor

Currently, it's not cleanly possible to convert a NotNan<f64> to a NotNan<f32> if you're aware of the precision loss and are ready to take it without unwrapping and re-wrapping again.

So this PR addresses this through adding a NotNan::<f64>::into_notnan_f64_lossy which does that automatically.

I'm not sure about the naming of the method. I'd like to shorten it, and also I'm not sure whether that's a case for using as_ naming, as the Rust API guidelines suggest.

@mbrubeck
Copy link
Collaborator

Thanks!

For naming, I think a shorter name like as_f32 or to_32_bit would be fine.

@MultisampledNight
Copy link
Contributor Author

Thank you for the consideration! I changed the name as_f32 accordingly.

@mbrubeck mbrubeck merged commit 61975f1 into reem:master Apr 30, 2022
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

Successfully merging this pull request may close these issues.

2 participants