Module

Data.Binary.SignedInt

Package
purescript-binary
Repository
Unisay/purescript-binary

#SignedInt Source

newtype SignedInt b

Instances

#magnitude Source

magnitude :: forall b. SignedInt b -> b

#flipSign Source

flipSign :: forall b. SignedInt b -> SignedInt b

#complement Source

complement :: forall b. SignedInt b -> SignedInt b

#fromInt Source

fromInt :: forall b. Pos b => GtEq b D32 => b -> Int -> SignedInt b

Converts Int value to SignedInt b for b >= 31

#fromUnsigned Source

fromUnsigned :: forall b a. Pos a => Pos b => Lt a b => UnsignedInt a -> SignedInt b

#tryFromUnsigned Source

tryFromUnsigned :: forall b. Pos b => UnsignedInt b -> Maybe (SignedInt b)

#unsafeToUnsigned Source

unsafeToUnsigned :: forall b. Pos b => SignedInt b -> UnsignedInt b

#toInt Source

toInt :: forall b. Pos b => LtEq b D32 => SignedInt b -> Int

#asBits Source

asBits :: forall b a. Pos a => Pos b => Lt a b => SignedInt a -> SignedInt b

#asBits' Source

asBits' :: forall b a. Pos a => Pos b => Lt a b => b -> SignedInt a -> SignedInt b

#tryAsBits Source

tryAsBits :: forall b a. Pos a => Pos b => Gt a b => SignedInt a -> Maybe (SignedInt b)

#tryAsBits' Source

tryAsBits' :: forall b a. Pos a => Pos b => Gt a b => b -> SignedInt a -> Maybe (SignedInt b)

#isNegative Source

isNegative :: forall a. Binary a => a -> Boolean

#toString2c Source

toString2c :: forall b. Pos b => Gt b D2 => Radix -> SignedInt b -> String

two's complement