mirror of
https://github.com/theoludwig/libcproject.git
synced 2024-12-11 21:13:00 +01:00
feat: add mathematics_opposite
This commit is contained in:
parent
c49d5f5421
commit
85ce5228ef
@ -32,3 +32,7 @@ float mathematics_square_root(float number) {
|
||||
unsigned long long mathematics_factorial(unsigned long long number) {
|
||||
return number == 0 ? 1 : number * mathematics_factorial(number - 1);
|
||||
}
|
||||
|
||||
int64_t mathematics_opposite(int64_t number) {
|
||||
return number * -1;
|
||||
}
|
||||
|
@ -66,4 +66,12 @@ float mathematics_square_root(float number);
|
||||
*/
|
||||
unsigned long long mathematics_factorial(unsigned long long number);
|
||||
|
||||
/**
|
||||
* @brief Calulcates the opposite number (additive inverse).
|
||||
*
|
||||
* @param number
|
||||
* @return int64_t
|
||||
*/
|
||||
int64_t mathematics_opposite(int64_t number);
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user