Integral – Integral Types

The Integral class extends the Num class and supports two additional methods for working with integral numbers, integer division and integer remainder:

div, mod :: a -> a -> a

ghci> 5 `div` 3

ghci> 5 `mod` 3

Basic types Int and Integer are instances of the Integral class.

Last updated