8 kyu
Return Negative
22,252 of 374,742Deantwo
Description:
In this simple assignment you are given a number and have to make it negative. But maybe the number is already negative?
Examples
Kata.MakeNegative(1); // return -1
Kata.MakeNegative(-5); // return -5
Kata.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.
Fundamentals
Similar Kata:
Stats:
Created | May 29, 2015 |
Published | May 29, 2015 |
Warriors Trained | 440417 |
Total Skips | 21679 |
Total Code Submissions | 845049 |
Total Times Completed | 374742 |
C# Completions | 22252 |
Python Completions | 118269 |
JavaScript Completions | 142573 |
Haskell Completions | 2341 |
Ruby Completions | 7445 |
Java Completions | 36545 |
CoffeeScript Completions | 148 |
C++ Completions | 24573 |
Elixir Completions | 887 |
TypeScript Completions | 5147 |
Go Completions | 7384 |
Julia Completions | 248 |
Kotlin Completions | 3689 |
NASM Completions | 192 |
Groovy Completions | 224 |
Scala Completions | 1100 |
C Completions | 9935 |
PHP Completions | 5966 |
Racket Completions | 161 |
CFML Completions | 48 |
Crystal Completions | 56 |
R Completions | 495 |
Dart Completions | 1968 |
Perl Completions | 174 |
COBOL Completions | 93 |
Factor Completions | 31 |
D Completions | 41 |
OCaml Completions | 230 |
CommonLisp Completions | 133 |
Clojure Completions | 86 |
Rust Completions | 1153 |
Total Stars | 1500 |
% of votes with a positive feedback rating | 91% of 23057 |
Total "Very Satisfied" Votes | 19333 |
Total "Somewhat Satisfied" Votes | 3298 |
Total "Not Satisfied" Votes | 426 |