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
The function into_float_with_exponent implements the standard bit-pattern hack to grab the 53 significant bits and subtract 1. However, according to http://xoshiro.di.unimi.it/ (see section "Generating uniform doubles in the unit interval") this halves the range of possible values by always resulting a least significant bit of zero. It is proposed to just use the more straight-forward (myint>>11) as f64 / (1u64 << 53) as f64 instead.
The text was updated successfully, but these errors were encountered:
@jasondark Thank you for opening this issue. Just a couple of days late for the party, see #416 which had similar concerns.
In a way both methods are imperfect, as floats do not have a fixed precision. But we changed the default method to the traditional multiply approach in #420.
The function
into_float_with_exponent
implements the standard bit-pattern hack to grab the 53 significant bits and subtract 1. However, according to http://xoshiro.di.unimi.it/ (see section "Generating uniform doubles in the unit interval") this halves the range of possible values by always resulting a least significant bit of zero. It is proposed to just use the more straight-forward(myint>>11) as f64 / (1u64 << 53) as f64
instead.The text was updated successfully, but these errors were encountered: