Both Zero, Negative or Positive

Published by Nomore in

Write a function that returns true if both numbers are:

  • Smaller than 0, OR ...
  • Greater than 0, OR ...
  • Exactly 0

Otherwise, return false.

Examples

Both(6, 2) ➞ true

Both(0, 0) ➞ true

Both(-1, 2) ➞ false

Both(0, 2) ➞ false

Notes

Inputs will always be two numbers.

Watch a quick demo on how Edabit works.