0

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

Mikkel
  • 7,693
  • 3
  • 17
  • 31
Tyler Joe
  • 357
  • 2
  • 18
  • @FrownyFrog That should have been an answer. Either way, the question has been asked already. – Zeta Dec 15 '18 at 18:36

1 Answers1

2

Without outright stating the solution, here are some functions you may find handy:

The details of your hypotenuse function are up to you, so I will leave the implementation to your discretion.

AJF
  • 11,767
  • 2
  • 37
  • 64