Q:

Dividing by huge numbers in haskell

How do I get a number in decimal format when performing 1/200!
Prelude>factorial x = product([1..x])
Prelude>x = factorial 200
Prelude>1/x
0.0

A:

You could use CReal:
Data.Number.CReal> showCReal 400 (1/product [1..200])
"0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012679769534809624217530164"
Data.Number.CReal> showCReal 30 (1e375/product [1..200])
"1.267976953480962421753016371075"

The 400/30 there is how many digits to show.
If you like the speed of Double, you could consider scaling each number before computing the product.
>  product (map (100/) [1..200])
1.2679769534809638e25

That requires a bit of reinterpretation of the output, though.

