I need a function that takes two Int ( a and b ) and returns A/B as Int . I am sure that A/B will always be an integer.
Here is my solution:
myDiv :: Int -> Int -> Int myDiv ab = let x = fromIntegral a y = fromIntegral b in truncate (x / y)
But you want to find a simpler solution. Something like that:
myDiv :: Int -> Int -> Int myDiv ab = a / b
How can I split Int by Int and get Int?
int haskell
demas Dec 05 '10 at 13:30 2010-12-05 13:30
source share