Browse Source

absolute funktion

remotes/origin/Abdelrahman
Abdelrahman 11 months ago
parent
commit
0100fa823d
  1. 6
      src/c/funktionen.c

6
src/c/funktionen.c

@ -1,6 +1,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include <math.h>
#include "funktionen.h" #include "funktionen.h"
// Function to calculate the square of a number // Function to calculate the square of a number
@ -26,3 +27,8 @@ return x * x * x;
float cubeRoot(float x) { float cubeRoot(float x) {
return cbrt(x); return cbrt(x);
} }
// Function to calculate the absolute value of a number
float absolute(float x) {
return fabs(x);
}
Loading…
Cancel
Save