From 07e77936d535e58b0aeb4f2a11400c1050556739 Mon Sep 17 00:00:00 2001 From: Nicholas Noll Date: Sun, 5 Dec 2021 16:16:21 -0800 Subject: Feat: added math library Used Plan9's libc as starting point. This cleans up dangling references due to loss of libc. --- src/libbio/newick.c | 2 +- src/libbio/phylo.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/libbio') diff --git a/src/libbio/newick.c b/src/libbio/newick.c index a555379..6071c1e 100644 --- a/src/libbio/newick.c +++ b/src/libbio/newick.c @@ -118,7 +118,7 @@ lex(io·Peeker s, void* fp) *c = 0; tok.kind = tok·number; - tok.lit.x = atof(b); + tok.lit.x = str·atof(b); return tok; case '\"': diff --git a/src/libbio/phylo.c b/src/libbio/phylo.c index 1b0ae59..2343e23 100644 --- a/src/libbio/phylo.c +++ b/src/libbio/phylo.c @@ -393,10 +393,10 @@ phylo·reroot(bio·Tree *tree, bio·Node *node, double d) // TODO: should check that node is part of this tree? // TODO: should we check if node->parent != nil? - if(fabs(d) < PREC){ + if(math·fabs(d) < PREC){ new = node; rotateparent(node->parent, node); - }else if(fabs(d-node->dist) < PREC){ + }else if(math·fabs(d-node->dist) < PREC){ new = node->parent; if (new->parent->parent) { rotateparent(new->parent->parent, new->parent); -- cgit v1.2.1