X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FIntegration%2FTrapezoid.hs;h=5452a5e8a5fe70195cf3de6711934dadd8cb623d;hb=c3905924154d9a8d56bdc57e2f36fe48b8524eef;hp=8d4b76903b04603a09ebb748e501582b4026b0c6;hpb=e09978f7c891cf2d752f841ad6b90a0b51c9da9d;p=numerical-analysis.git diff --git a/src/Integration/Trapezoid.hs b/src/Integration/Trapezoid.hs index 8d4b769..5452a5e 100644 --- a/src/Integration/Trapezoid.hs +++ b/src/Integration/Trapezoid.hs @@ -30,7 +30,7 @@ trapezoid_1 :: (RealFrac a, Fractional b, Num b) -> a -- ^ The \"right\" endpoint, @b@ -> b trapezoid_1 f a b = - (((f a) + (f b)) / 2) * (fromRational $ toRational (b - a)) + (((f a) + (f b)) / 2) * (realToFrac (b - a)) -- | Use the composite trapezoid rule to numerically integrate @f@