module Data.Numbers.CrackNum.Data where
data Precision = HP
| SP
| DP
deriving (Precision -> Precision -> Bool
(Precision -> Precision -> Bool)
-> (Precision -> Precision -> Bool) -> Eq Precision
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Precision -> Precision -> Bool
$c/= :: Precision -> Precision -> Bool
== :: Precision -> Precision -> Bool
$c== :: Precision -> Precision -> Bool
Eq, Int -> Precision -> ShowS
[Precision] -> ShowS
Precision -> String
(Int -> Precision -> ShowS)
-> (Precision -> String)
-> ([Precision] -> ShowS)
-> Show Precision
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Precision] -> ShowS
$cshowList :: [Precision] -> ShowS
show :: Precision -> String
$cshow :: Precision -> String
showsPrec :: Int -> Precision -> ShowS
$cshowsPrec :: Int -> Precision -> ShowS
Show)
data IPrecision = W8
| I8
| W16
| I16
| W32
| I32
| W64
| I64
deriving IPrecision -> IPrecision -> Bool
(IPrecision -> IPrecision -> Bool)
-> (IPrecision -> IPrecision -> Bool) -> Eq IPrecision
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IPrecision -> IPrecision -> Bool
$c/= :: IPrecision -> IPrecision -> Bool
== :: IPrecision -> IPrecision -> Bool
$c== :: IPrecision -> IPrecision -> Bool
Eq
data Kind = Zero Bool
| Infty Bool
| SNaN
| QNaN
| Denormal
| Normal
isNaNKind :: Kind -> Bool
isNaNKind :: Kind -> Bool
isNaNKind SNaN = Bool
True
isNaNKind QNaN = Bool
True
isNaNKind _ = Bool
False
instance Show IPrecision where
show :: IPrecision -> String
show W8 = "Unsigned Byte"
show I8 = "Signed Byte"
show W16 = "Unsigned Word"
show I16 = "Signed Word"
show W32 = "Unsigned Double"
show I32 = "Signed Double"
show W64 = "Unsigned Quad"
show I64 = "Signed Quad"
data FP = FP { FP -> Integer
intVal :: Integer
, FP -> Precision
prec :: Precision
, FP -> Bool
sign :: Bool
, FP -> Int
stExpt :: Int
, FP -> Int
bias :: Int
, FP -> Int
expt :: Int
, FP -> [Bool]
fracBits :: [Bool]
, FP -> String
bitLayOut :: String
, FP -> Kind
kind :: Kind
}