Skip to content
This repository has been archived by the owner on Jul 21, 2024. It is now read-only.

Commit

Permalink
Added the possibility to get the negative of a number (#319)
Browse files Browse the repository at this point in the history
  • Loading branch information
lpeyr committed May 8, 2022
1 parent 1a8b426 commit c285362
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions LeoCorpLibrary/Maths.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ public static double DegreesToRadians(double degrees)
/// <returns>A <see cref="double"/> value, the positive of the number.</returns>
public static double GetPositive(double n) => n >= 0 ? n : -n;

public static double GetNegative(double n) => n <= 0 ? n : -n;


/// <summary>
/// Returns the factorial of a specified number.
Expand Down

0 comments on commit c285362

Please sign in to comment.