Fork me on GitHub
#clojure-dev
<
2018-06-15
>
gfredericks15:06:48

I don't see a ticket about rand-int only working for the int range it's a pretty easy problem to run into, and the cost for existing uses would presumably be just the effort of checking if the arg is in the int range the current version actually has the weirder behavior that it only fails if the result is out of the int range, regardless of the argument

gfredericks15:06:01

so (rand-int (* 2 Integer/MAX_VALUE)) fails only about half the time

gfredericks15:06:41

cljs already supports larger arguments (though it probably goes arguably too far in the other direction and happily generates too-large-to-be-integers results as well)