
23 Apr
2010
23 Apr
'10
1:46 p.m.
Am Freitag 23 April 2010 15:33:43 schrieb Giorgio Stefanoni:
However, if I try to generate a Float instead, I always get an Arithmetic Overflow error that I can not understand.
Code:
rand :: IO Float rand = do r <- newStdGen let (x1, r2) = randomR (0.0::Float,1.0::Float) r print x1 return x1
Works here. And it should. Must be the implementation you use, though I can't imagine why it would screw up on this.
Do you have any clue why this happens?
Thanks in advance,