]> gitweb.michael.orlitzky.com - numerical-analysis.git/blobdiff - src/Misc.hs
Switch Linear.Vector to the numeric prelude and add the element_sum function to it.
[numerical-analysis.git] / src / Misc.hs
index ddaad6e3ba7061f9a3ee2c119998058b3d298201..bf8414d8e859d671e5c5c8794e63ea31680f4b0a 100644 (file)
@@ -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