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

fix rand(Float16|Float32) equal to 1 #9387

Merged
merged 1 commit into from
Dec 23, 2014
Merged

fix rand(Float16|Float32) equal to 1 #9387

merged 1 commit into from
Dec 23, 2014

Commits on Dec 20, 2014

  1. fix rand(Float16|Float32) equal to 1

    Cf. bug reported by @tkelman in #9301.
    As noted by @ivarne, converting a Float64 different from 1 to Float16
    or Float32 can produce a value equal to one, which doesn't agree with
    the documented API.
    So instead of converting, let's produce a Float16/Float32 in [1,2) at
    the bit level, and then substract 1 (as was done in the array versions).
    As a side effect, this also makes rand(Float16) about twice as fast.
    rfourquet committed Dec 20, 2014
    Configuration menu
    Copy the full SHA
    f1ab1c9 View commit details
    Browse the repository at this point in the history