DEV Community

Discussion on: Daily Challenge #57 - BMI Calculator

Collapse
 
craigmc08 profile image
Craig McIlwrath

Haskell

bmi :: Double -> Double -> String
bmi weight height
  | x <= 18.5 = "Underweight"
  | x <= 25 = "Normal" 
  | x <= 30 = "Overweight"
  | otherwise = "Obese"
  where x = weight / (height*height)