X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FMisc.hs;h=c81d3594fad218bd6d76d224e3aa942071c0a1cf;hb=9ef91ad4ec3a5c0966f0850d40310722b6c38b68;hp=ddaad6e3ba7061f9a3ee2c119998058b3d298201;hpb=a615055dd6d6a0bd59aa7ba03305388f786306cb;p=numerical-analysis.git diff --git a/src/Misc.hs b/src/Misc.hs index ddaad6e..c81d359 100644 --- a/src/Misc.hs +++ b/src/Misc.hs @@ -6,9 +6,9 @@ module Misc where import NumericPrelude -import Algebra.Field -import Algebra.RealRing -import Algebra.ToInteger +import Algebra.Field ( C ) +import Algebra.RealRing ( C ) +import Algebra.ToInteger ( C ) -- | Partition the interval [@a@, @b@] into @n@ subintervals, which we -- then return as a list of pairs. @@ -36,7 +36,8 @@ partition n a b let xi = a + k'*h, let xj = a + (k'+1)*h ] where - h = (b-a)/(fromIntegral $ toInteger n) + coerced_n = fromIntegral $ toInteger n + h = (b-a)/coerced_n -- | Compute the unit roundoff (machine epsilon) for this machine. We