From 03eaadd587f20113681ce553fa49a0de5585c942 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 30 Dec 2018 17:47:26 -0500 Subject: Use lround() instead of sketchy offset and cast --- src/node.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node.c b/src/node.c index 9b36a55a..a63d350c 100644 --- a/src/node.c +++ b/src/node.c @@ -290,7 +290,7 @@ serd_node_new_decimal(double d, unsigned frac_digits) *s++ = '0'; node.n_bytes = node.n_chars = (s - buf); } else { - uint64_t frac = frac_part * pow(10.0, (int)frac_digits) + 0.5; + uint64_t frac = lround(frac_part * pow(10.0, (int)frac_digits)); s += frac_digits - 1; unsigned i = 0; -- cgit v1.2.1