value = njs_arg(args, nargs, 1);
indent = njs_arg(args, nargs, 2);
- n = indent->data.u.number;
+ n = njs_primitive_value_to_integer(indent);
n = nxt_min(n, 5);
if (njs_vm_value_dump(vm, &str, value, n) != NXT_OK) {
{
int64_t i64;
+#if (NXT_NAN_TO_UINT_CONVERSION != 0)
+ /*
+ * PPC32: NaN and Inf are converted to 0x8000000080000000
+ * and become non-zero after truncation.
+ */
+
+ if (isnan(num) || isinf(num)) {
+ return 0;
+ }
+#endif
+
/*
* ES5.1: integer must be modulo 2^32.
* 2^53 is the largest integer number which can be stored safely
. ${NXT_AUTO}feature
fi
+
+
+nxt_feature="NAN to uint conversion"
+nxt_feature_name=NXT_NAN_TO_UINT_CONVERSION
+nxt_feature_run=value
+nxt_feature_incs=
+nxt_feature_libs=-lm
+nxt_feature_test="#include <math.h>
+ #include <stdio.h>
+ #include <stdint.h>
+
+ int main(void) {
+ int64_t i64 = sqrt(-1);
+ printf(\"%x\", (uint32_t) i64);
+ return 0;
+ }"
+. ${NXT_AUTO}feature