From 363ce644f1f4b18a271355a5d21c806ca437651b Mon Sep 17 00:00:00 2001 From: William Blackerby Date: Sat, 30 Aug 2014 18:22:14 -0500 Subject: [PATCH] Small correction to 5-recursion.hs solution In line 66, there is no argument for step in the call to stepReverseSign. I propose hardcoding the integer 2. --- 5-recursion.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/5-recursion.hs b/5-recursion.hs index 6baea90..ccbd648 100644 --- a/5-recursion.hs +++ b/5-recursion.hs @@ -63,7 +63,7 @@ piCalc tolerance = piCalc' 1 0.0 tolerance 0 piCalc' :: (Ord a, Fractional a, Integral b) => a -> a -> a -> b -> (a, b) piCalc' denom prevPi tolerance count = if abs(newPi - prevPi) < tolerance then (newPi, count) - else piCalc' (stepReverseSign denom) newPi tolerance (count + 1) + else piCalc' (stepReverseSign denom 2) newPi tolerance (count + 1) where newPi = prevPi + (4 / denom)