reiddraper / simple-check

QuickCheck for Clojure
http://reiddraper.github.io/simple-check/
286 stars 18 forks source link

fix generators/rand-range to handle/emit the full range of longs, fixes gh-37 #42

Closed cemerick closed 10 years ago

cemerick commented 10 years ago

Basic form pulled from data.generators/uniform, though that impl has the same fundamental problem. Fixed by scaling the components of the diff before actually determining the diff. This only works because the random factor is a double, so the diff can exceed the range of longs safely, but is brought back inside that range by the addition of lower before being floored.