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
Random.rand takes any Float and returns a Float64. to_f32 is needed to cast back to a Float32.
To be consistent with other methods taking integers, like Random.rand(max : Int) : Int, which returns the same type as the given integer, I suggest to have the method returning a Float32 if one was given.
Example of the current behavior: p typeof(Random.rand(1_f32)) #=> Float64
The text was updated successfully, but these errors were encountered:
Random.rand
takes anyFloat
and returns aFloat64
.to_f32
is needed to cast back to aFloat32
.To be consistent with other methods taking integers, like
Random.rand(max : Int) : Int
, which returns the same type as the given integer, I suggest to have the method returning aFloat32
if one was given.Example of the current behavior:
p typeof(Random.rand(1_f32)) #=> Float64
The text was updated successfully, but these errors were encountered: