diff options
author | David Robillard <d@drobilla.net> | 2018-12-30 17:47:26 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-01-05 18:55:50 +0100 |
commit | 17b3fdccc2aba581c27913e5a624752309bedcda (patch) | |
tree | e1487d74d837c6e804c8c1891c37772185c0a24c | |
parent | 04e6f01432a5888a6abf95d6dfdec8094c380e70 (diff) | |
download | serd-17b3fdccc2aba581c27913e5a624752309bedcda.tar.gz serd-17b3fdccc2aba581c27913e5a624752309bedcda.tar.bz2 serd-17b3fdccc2aba581c27913e5a624752309bedcda.zip |
Use lround() instead of sketchy offset and cast
-rw-r--r-- | src/node.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; |