precursor-0.1.0.0: Prelude replacement
Precursor.Numeric.Integral
Synopsis
class Semiring a => Integral a where Source #
An integral domain. Members of this class must be Semirings with commutative *.
Semiring
*
a * b = b * a
(a // b) * b + (a % b) = a
//
+
%
(a'+'k'*'b) % b = a % b
zero % b = zero
zero
Minimal complete definition
divMod | (//), (%)
Methods
divMod :: a -> a -> (a, a) Source #
The divisor and modulo
(//) :: a -> a -> a infixl 7 Source #
Integer division
(%) :: a -> a -> a infixl 7 Source #
Modulo
Instances
divMod :: Int -> Int -> (Int, Int) Source #
(//) :: Int -> Int -> Int Source #
(%) :: Int -> Int -> Int Source #
divMod :: Int8 -> Int8 -> (Int8, Int8) Source #
(//) :: Int8 -> Int8 -> Int8 Source #
(%) :: Int8 -> Int8 -> Int8 Source #
divMod :: Int16 -> Int16 -> (Int16, Int16) Source #
(//) :: Int16 -> Int16 -> Int16 Source #
(%) :: Int16 -> Int16 -> Int16 Source #
divMod :: Int32 -> Int32 -> (Int32, Int32) Source #
(//) :: Int32 -> Int32 -> Int32 Source #
(%) :: Int32 -> Int32 -> Int32 Source #
divMod :: Int64 -> Int64 -> (Int64, Int64) Source #
(//) :: Int64 -> Int64 -> Int64 Source #
(%) :: Int64 -> Int64 -> Int64 Source #
divMod :: Integer -> Integer -> (Integer, Integer) Source #
(//) :: Integer -> Integer -> Integer Source #
(%) :: Integer -> Integer -> Integer Source #
even :: Integral a => a -> Bool #
odd :: Integral a => a -> Bool #