-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
add RoundingMode argument to convert #8845
Conversation
6fe2d1e
to
86761e6
Compare
It turns out to be significantly quicker to just do an explicit check than actually play around with rounding modes (about 20x for Float64 -> Float32). |
Love this. |
Great! Could we add these methods to Why are the |
The I'll look at moving it from That said, it did occur to me that this is actually much more general: once we have correct comparisons, the code I've used in the |
This is nice. |
Okay, I've moved the rounding versions from |
I think the documentation could go in: with a mention in: |
This didn't merge cleanly anymore, so i rebased and added some docs. |
Thanks for doing that, I didn't get time to look at it over the weekend. |
Adds an extra
RoundingMode
argument to someconvert
calls. This allows things likeThis uses stagedfunctions internally, so reduce to constants at runtime. I've also tried to improve the docs a bit.
It occurs to me that we could also use also stagedfunctions to get rid of the "value" argument in the
@math_const
macro.cc: @nolta