From 91ba8d02037cc27c7b44f1bfd492c42ccd0af042 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Mon, 24 May 2021 18:50:55 +0200 Subject: Added more tests and fixed dumb bugs typical --- libs/libc/math.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'libs/libc/math.c') diff --git a/libs/libc/math.c b/libs/libc/math.c index b84958b..23b1ca4 100644 --- a/libs/libc/math.c +++ b/libs/libc/math.c @@ -2,6 +2,11 @@ #include +f32 powf(f32 base, f32 exp) +{ + return (f32)pow(base, exp); +} + f64 pow(f64 base, f64 exp) { f64 out; @@ -26,6 +31,12 @@ f64 pow(f64 base, f64 exp) } // TODO: More efficient sqrt? + +f32 sqrtf(f64 num) +{ + return powf(num, .5); +} + f64 sqrt(f64 num) { return pow(num, .5); -- cgit v1.2.3