You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yeah, the float division implementation is pretty fragile. The proposed fix would make f32 also use u128 math, which is better to avoid when not necessary.
Do you have a usecase where you want to tweak this? I am refactoring this as part of #622, but don'tr really plan to expose this configuration (instead it will use full iterations only if 2xBITS is <= pointer width, so it will start avoiding 64-bit math on <=32-bit platforms).
Do you have a usecase where you want to tweak this?
I don't. I just found this bug because I essentially forked this code to run in a const fn as a soft float. (So my only usecase here would be "I wish all of these functions were const fn".)
Oh, that is an interesting idea. In theory all of these should be usable for expansion at comptime, but the use of traits probably makes it pretty hard to use directly in actual const functions. The compiler uses rustc_apfloat for its comptime math, but it is also generic.
const float math has been proposed for stabilization, so maybe you won't need this at all soon rust-lang/rust#128596.
It looks like this codepath is completely broken. If enabled like this:
it fails with an overflow:
Looking at this code and looking at the
div32
implementation I'm guessing this is how it should be fixed?The text was updated successfully, but these errors were encountered: