1 {-# LANGUAGE ForeignFunctionInterface, MagicHash #-}
2 module Data
.Floating
.Instances
() where
4 import Prelude
hiding (Ord
(..), Double)
7 import Data
.Floating
.Classes
8 import Data
.Floating
.Double
9 import Data
.Floating
.Types
10 import Data
.Floating
.CMath
15 foreign import ccall unsafe
"double_compare"
16 double_compare
:: CDouble
-> CDouble
-> CInt
18 instance Poset
Double where
19 compare a b
= toEnum . fromIntegral $ double_compare a
' b
' where
23 D
# x
<= D
# y
= x
<=## y
24 D
# x
>= D
# y
= x
>=## y
27 instance Sortable
Double where
28 isSignificant
= not . ((== FPNaN
) . classify
)
29 max = libmDouble2 c_fmax
30 min = libmDouble2 c_fmin