8 kyu
Return Negative
21,938 of 368,955Deantwo
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 | 433684 |
Total Skips | 21352 |
Total Code Submissions | 833435 |
Total Times Completed | 368955 |
C# Completions | 21938 |
Python Completions | 115933 |
JavaScript Completions | 140897 |
Haskell Completions | 2324 |
Ruby Completions | 7404 |
Java Completions | 36041 |
CoffeeScript Completions | 147 |
C++ Completions | 24055 |
Elixir Completions | 880 |
TypeScript Completions | 5024 |
Go Completions | 7233 |
Julia Completions | 246 |
Kotlin Completions | 3643 |
NASM Completions | 190 |
Groovy Completions | 221 |
Scala Completions | 1094 |
C Completions | 9768 |
PHP Completions | 5891 |
Racket Completions | 157 |
CFML Completions | 47 |
Crystal Completions | 55 |
R Completions | 488 |
Dart Completions | 1916 |
Perl Completions | 168 |
COBOL Completions | 89 |
Factor Completions | 29 |
D Completions | 40 |
OCaml Completions | 224 |
CommonLisp Completions | 125 |
Clojure Completions | 78 |
Rust Completions | 1070 |
Total Stars | 1483 |
% of votes with a positive feedback rating | 91% of 22894 |
Total "Very Satisfied" Votes | 19190 |
Total "Somewhat Satisfied" Votes | 3282 |
Total "Not Satisfied" Votes | 422 |