Search code examples
haskelldivisionfloor

Floor of the result of a division


In Haskell, how can I get the floor of the result of a division between two Integers?

The function would be something like this:

floorOfDivision :: Int -> Int -> Int
floorOfDivision x y = x `someFunction` y

Solution

  • The function is div from Prelude.

    5 `div` 2 == 2