Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

random.initRand crashes in Nim 0.20.0 JS backend #11450

dom96 opened this issue Jun 9, 2019 · 0 comments


Copy link

commented Jun 9, 2019

Under certain circumstances initRand crashes with a RangeError.


import random
proc onLoad() {.exportC.} =
  let r = initRand(1560090106546000100)

when isMainModule and defined(c):

Works when compiled and run with c. But fails with the following under js:

Error: Error: unhandled exception: value out of range [RangeError]
Traceback (most recent call last)
a2.onLoad, line: 3
random.initRand, line: 540

The value that I used above was generated by randomise

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
1 participant
You can’t perform that action at this time.