r/purescript • u/ulius • Jun 27 '18
Big Int Problem
Hello,
I'm new to purescript and trying to study by solving eulers project exercises. and with 3rd had a problem:
Integer value 600851475143 is out of range for the JavaScript backend. Acceptable values fall within the range -2147483648 to 2147483647 (inclusive).
Maybe someone can help me with that,
Thanks :)
3
Upvotes
View all comments
Show parent comment
3
u/[deleted] Jun 27 '18
Ahh, that makes sense. That literal you're trying to pass to
solveis a regular oldInt, which doesn't support values that high. If you're using purescript-bigints thensolveneeds to take aBigInt, and you'll have to use functions likefromStringto construct that argument. For example: