summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2020-02-20 22:02:08 +0000
committerrodri <rgl@antares-labs.eu>2020-02-20 22:02:08 +0000
commit168a16b70a928ed64061bdac7fc9d52235c3f9fc (patch)
tree50ad23804ba927af802d42f2b7a450200fcbf2a7 /util.c
downloadballistics-168a16b70a928ed64061bdac7fc9d52235c3f9fc.tar.gz
ballistics-168a16b70a928ed64061bdac7fc9d52235c3f9fc.tar.bz2
ballistics-168a16b70a928ed64061bdac7fc9d52235c3f9fc.zip
git release.
Diffstat (limited to 'util.c')
-rw-r--r--util.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/util.c b/util.c
new file mode 100644
index 0000000..7edcd40
--- /dev/null
+++ b/util.c
@@ -0,0 +1,16 @@
+#include <u.h>
+#include <libc.h>
+#include "dat.h"
+#include "fns.h"
+
+double
+round(double n)
+{
+ return floor(n + 0.5);
+}
+
+double
+hypot3(double x, double y, double z)
+{
+ return hypot(x, hypot(y, z));
+}