diff options
Diffstat (limited to 'src/node.c')
-rw-r--r-- | src/node.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -211,6 +211,10 @@ SERD_API SerdNode serd_node_new_decimal(double d, unsigned frac_digits) { + if (isnan(d) || isinf(d)) { + return SERD_NODE_NULL; + } + const double abs_d = fabs(d); const unsigned int_digits = (unsigned)fmax(1.0, ceil(log10(abs_d + 1))); char* buf = (char*)calloc(int_digits + frac_digits + 3, 1); |