Skip to content

Stack overflow death

GHCI dies without any warning, if evaluation of the function ex3 in the following code fragment is attempted:

ex2 x partial sum n = let partial = partial * x / fromIntegral(n)
                      in if (partial + sum == sum)
                            then sum
                            else ex2 x partial (sum + partial) (n+1)

ex3 x = ex2 x 1 1.0 1
Edited by Ian Lynagh -
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information