G'day all.

Quoting Don Stewart <[EMAIL PROTECTED]>:

    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
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to