You can use CReal :
Data.Number.CReal> showCReal 400 (1/product [1..200])
"0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012679769534809624217530164"
Data.Number.CReal> showCReal 30 (1e375/product [1..200])
"1.267976953480962421753016371075"
400/ 30there are how many digits to display.
If you like speed Double, you might consider scaling each number before calculating the product.
> product (map (100/) [1..200])
1.2679769534809638e25
This requires a bit of reinterpretation of the output.
source
share