]> gitweb.michael.orlitzky.com - numerical-analysis.git/blobdiff - src/Misc.hs
Fix bugs in big_K, big_M.
[numerical-analysis.git] / src / Misc.hs
index ddaad6e3ba7061f9a3ee2c119998058b3d298201..c81d3594fad218bd6d76d224e3aa942071c0a1cf 100644 (file)
@@ -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