I have a simple function, which is to get the hypotenuse of a pythagorean triangle, but for the type of Int.
Here is my code:
hypotenuse :: Int -> Int -> Int
hypotenuse a b = sqrt(a*a + b*b)
I need to round up the result.
For example: hypotenuse 500 0 --result:500 :: Int
hypotenuse 500 30 --result:501 :: Int