Skip to content

Latest commit

 

History

History
17 lines (13 loc) · 261 Bytes

opposite_number.md

File metadata and controls

17 lines (13 loc) · 261 Bytes

Description

Very simple, given an integer or a floating-point number, find its opposite.

Examples:

1: -1
14: -14
-34: 34

My Solution

def opposite(num)
  -num
end