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

#takeSignedInt Source

takeSignedInt :: forall b. Pos b => Gt b D2 => Bits -> 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 => Gt b D2 => Lt a b => UnsignedInt a -> SignedInt b

#fromUnsignedUnsafe Source

fromUnsignedUnsafe :: forall b a. Pos a => Pos b => UnsignedInt a -> SignedInt b

#tryFromUnsigned Source

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

#toUnsigned Source

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

#positiveToUnsigned Source

positiveToUnsigned :: forall b. Pos b => SignedInt b -> Maybe (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

#tryAsBits Source

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

#isNegative Source

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

#complement Source

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

#flipSign Source

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

#toString2c Source

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

two's complement