aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS3
-rw-r--r--src/node.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 144b4c63..84eb68ef 100644
--- a/NEWS
+++ b/NEWS
@@ -5,11 +5,12 @@ serd (0.21.1) unstable;
* Add serd_reader_set_strict() and -l (lax) option to serdi to tolerate
parsing URIs with escaped characters
* Fix reading statements ending with a blank then dot with no space
+ * Fix serializing fractional decimals that would round up
* Add support for Turtle named inline nodes extension
* Report errors for invalid IRI characters and missing terminators
* Fix warnings when building with ISO C++ compilers
- -- David Robillard <d@drobilla.net> Wed, 17 Dec 2014 00:49:08 -0500
+ -- David Robillard <d@drobilla.net> Sat, 04 Apr 2015 16:22:17 -0400
serd (0.20.0) stable;
diff --git a/src/node.c b/src/node.c
index 6b35dd79..1f8cb115 100644
--- a/src/node.c
+++ b/src/node.c
@@ -219,7 +219,7 @@ serd_node_new_uri(const SerdURI* uri, const SerdURI* base, SerdURI* out)
static inline unsigned
serd_digits(double abs)
{
- const double lg = ceil(log10(abs + 1.0));
+ const double lg = ceil(log10(floor(abs) + 1.0));
return lg < 1.0 ? 1U : (unsigned)lg;
}