KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I need a function which gets two Int s ( 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 a b = let x = fromIntegral a y = fromIntegral b in truncate (x / y) But want to find more simpler solution. Something like this: myDiv :: Int -> Int -> Int myDiv a b = a / b How can I divide Int to Int and get Int ?
Tags (comma-separated)
Save Edits
Cancel