How to find the opposite number in C#?
How to find the opposite number in C#? #csharp #dotnet #math
We want to return the opposite number.
1: -1 14: -14 -34: 34
Another solution is:
return n * -1;
A SO reference:
Kata from codewars:
Read more about Math Functions:
- Sinh / Cosh
- Asin / Acos
These functions can be important if you're going to work with numbers.