Support NaN in path expressions (fix #962)
This commit is contained in:
1 parent
c4524da3e0
commit
4490d9d1f6
2 files changed
+6
-1
No files matched your search
@@ -6,6 +6,7 @@
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <limits.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "jv_alloc.h"
|
||||
#include "jv.h"
|
||||
@@ -1302,7 +1303,7 @@ int jv_identical(jv a, jv b) {
|
||||
r = a.u.ptr == b.u.ptr;
|
||||
break;
|
||||
case JV_KIND_NUMBER:
|
||||
r = a.u.number == b.u.number;
|
||||
r = a.u.number == b.u.number || (isnan(a.u.number) && isnan(b.u.number));
|
||||
break;
|
||||
default:
|
||||
r = 1;
|
||||
|
||||
@@ -851,6 +851,10 @@ try (def x: reverse; x=10) catch .
|
||||
[0,1,2]
|
||||
"Invalid path expression with result [2,1,0]"
|
||||
|
||||
.[] = 1
|
||||
[1,null,Infinity,-Infinity,NaN,-NaN]
|
||||
[1,1,1,1,1,1]
|
||||
|
||||
#
|
||||
# Conditionals
|
||||
#
|
||||
|
||||
Reference in new issue
Block a user