From 25537c3d3b9b68af91573dec39d1f46c3d97f735 Mon Sep 17 00:00:00 2001 From: Nicholas Noll Date: Fri, 10 Dec 2021 09:16:08 -0800 Subject: Checkin: small sprawling updates Small touches to multiple locations in base. Nothing major --- src/base/math/round.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/base/math/round.c (limited to 'src/base/math') diff --git a/src/base/math/round.c b/src/base/math/round.c new file mode 100644 index 0000000..a815152 --- /dev/null +++ b/src/base/math/round.c @@ -0,0 +1,13 @@ +#include +#include + +double +math·round(double x) +{ + double f; + + f = math·floor(x); + if((x-f) > 0.5) + return f+1; + return f; +} -- cgit v1.2.1