RosettaCodeData/Task/Variables/Haskell/variables-5.hs

4 lines
78 B
Haskell

signum x | x > 0 = 1
| x < 0 = -1
| otherwise = 0