diff options
author | Alberto Ruiz <aruiz@um.es> | 2008-10-23 13:30:33 +0000 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2008-10-23 13:30:33 +0000 |
commit | ce8fed3a3558468b128a03cc4c96aa6c11357b4d (patch) | |
tree | ff5fa5486e17007b06bfcdaf35779b828d102941 /lib/Data/Packed/Internal/Common.hs | |
parent | faeaf6d261b760e628c1e63551d822d16876c0cc (diff) |
NaN problem solved with asm(finit)
Diffstat (limited to 'lib/Data/Packed/Internal/Common.hs')
-rw-r--r-- | lib/Data/Packed/Internal/Common.hs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Data/Packed/Internal/Common.hs b/lib/Data/Packed/Internal/Common.hs index 3609bc2..bce9922 100644 --- a/lib/Data/Packed/Internal/Common.hs +++ b/lib/Data/Packed/Internal/Common.hs | |||
@@ -80,9 +80,14 @@ errorCode 2006 = "the input matrix is not positive definite" | |||
80 | errorCode 2007 = "not yet supported in this OS" | 80 | errorCode 2007 = "not yet supported in this OS" |
81 | errorCode n = "code "++show n | 81 | errorCode n = "code "++show n |
82 | 82 | ||
83 | |||
84 | -- | clear the fpu | ||
85 | foreign import ccall "auxi.h asm_finit" finit :: IO () | ||
86 | |||
83 | -- | check the error code | 87 | -- | check the error code |
84 | check :: String -> IO CInt -> IO () | 88 | check :: String -> IO CInt -> IO () |
85 | check msg f = do | 89 | check msg f = do |
90 | finit | ||
86 | err <- f | 91 | err <- f |
87 | when (err/=0) $ if err > 1024 | 92 | when (err/=0) $ if err > 1024 |
88 | then (error (msg++": "++errorCode err)) -- our errors | 93 | then (error (msg++": "++errorCode err)) -- our errors |