
5 Nov
2007
5 Nov
'07
6:55 p.m.
G'day all.
Quoting Don Stewart
calculatePi total g = fromIntegral (4*count) / fromIntegral total
This is slightly more robust in cases where the multiplication would overflow an Int: calculatePi total g = fromRational ((4*fromIntegral count) % fromIntegral total) Cheers, Andrew Bromage