diff options
Diffstat (limited to 'src/base/math/fabs.c')
-rw-r--r-- | src/base/math/fabs.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/base/math/fabs.c b/src/base/math/fabs.c new file mode 100644 index 0000000..feef84e --- /dev/null +++ b/src/base/math/fabs.c @@ -0,0 +1,10 @@ +#include <u.h> +#include <base.h> + +double +math·fabs(double arg) +{ + if(arg < 0) + return -arg; + return arg; +} |