From 0054dbc118c0d0292793e73bb99d5f884c03223a Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 28 Jul 2019 11:13:04 +0200 Subject: [PATCH] utilities:: kz --- util.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/util.cpp b/util.cpp index 4b2bc26c..469cc4f1 100644 --- a/util.cpp +++ b/util.cpp @@ -283,4 +283,25 @@ string parser_help() { } logger hlog; + +// kz: utility for printing +// if it is close to 0, assume it is floating errors + +ld kz(ld x) { + if(abs(x) < 1e-6) return 0; + return x; + } + +hyperpoint kz(hyperpoint h) { + for(int d=0; d