Descriptionmath/rand: Float32/64 must only return values in [0,1)
Float32 and Float64 are now both created by taking the ratio
of two integers which are chosen to fit entirely into the
precision of the desired float type. The previous code
could cast a Float64 with more than 23 bits of ".99999"
into a Float32 of 1.0, which is not in [0,1).
Float32 went from 15 to 21 ns/op (but is now correct).
Fixes issue 6721.
Patch Set 1 #Patch Set 2 : diff -r 0685a9549d5a https://code.google.com/p/go #Patch Set 3 : diff -r 0685a9549d5a https://code.google.com/p/go #Patch Set 4 : diff -r 0685a9549d5a https://code.google.com/p/go #
MessagesTotal messages: 4
|