File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ simdThreshold(::Type{Bool}) = 640
4646 ui = (x>>> 32 ) % UInt32
4747 li = x % UInt32
4848 u = _uint2float (ui, Float32)
49- l = _uint2float (ui , Float32)
49+ l = _uint2float (li , Float32)
5050 (UInt64 (reinterpret (UInt32, u)) << 32 ) | UInt64 (reinterpret (UInt32, l))
5151end
5252@inline function _bits2float (x:: UInt64 , :: Type{Float16} )
Original file line number Diff line number Diff line change @@ -1250,6 +1250,16 @@ end
12501250 @test length (xs) == 3
12511251end
12521252
1253+ @testset " Float32 RNG typo" begin
1254+ for T in (Float16, Float32, Float64)
1255+ # Make sure generated numbers are sufficiently diverse
1256+ # for both SIMD and non-SIMD RNG code paths for all types.
1257+ @test length (unique! (rand (T, 7 ))) > 3
1258+ @test length (unique! (rand (T, 14 ))) > 10
1259+ @test length (unique! (rand (T, 34 ))) > 20
1260+ end
1261+ end
1262+
12531263@testset " Docstrings" begin
12541264 @test isempty (Docs. undocumented_names (Random))
12551265end
You can’t perform that action at this time.
0 commit comments