package
0.0.0-20241102054555-b6e87e53946e
Repository: https://github.com/kotopheiop/gocodewarssolutions.git
Documentation: pkg.go.dev

# README

Return Negative

In this simple assignment you are given a number and have to make it negative. But maybe the number is already negative?

Examples

Input:  1  =>  Output: -1
Input: -5  =>  Output: -5
Input:  0  =>  Output:  0

MakeNegative(1)    // return -1
MakeNegative(-5)   // return -5
MakeNegative(0)    // return 0

Notes

  • The number can be negative already, in which case no change is required.
  • Zero (0) is not checked for any specific sign. Negative zeros make no mathematical sense.