Skip to content

Commit

Permalink
Debug uniformity check
Browse files Browse the repository at this point in the history
  • Loading branch information
konsumlamm committed Dec 3, 2023
1 parent 6400f46 commit fd85d94
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/trandom.nim
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ block: # check uniformity
let iBucket = (r-lo) div ((hi-lo) div initBigInt(nbuckets))
buckets[iBucket.toInt[:int]().get()] += 1
for x in buckets:
echo trials / nbuckets
echo float(x)
doAssert(trials/nbuckets*0.5 < float(x))
doAssert(float(x) < trials/nbuckets*1.5)

0 comments on commit fd85d94

Please sign in to comment.