We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ce30430 commit b2384b9Copy full SHA for b2384b9
tests/GraphBLAS-sharp.Tests/Generators.fs
@@ -47,12 +47,15 @@ module Generators =
47
48
let rec normalFloat32Generator (random: System.Random) =
49
gen {
50
- let result = random.NextSingle()
+ let rawValue = random.NextSingle()
51
52
- if System.Single.IsNormal result then
53
- return result
+ if System.Single.IsNormal rawValue then
+ let sign = float32 <| sign rawValue
54
+ let processedValue = ((+) 1.0f) <| (abs <| rawValue)
55
+
56
+ return processedValue * sign
57
else
- return! normalFloat32Generator random
58
+ return 0.0f
59
}
60
61
let genericSparseGenerator zero valuesGen handler =
0 commit comments