Commit 74a47d1f authored by Eli Zaretskii's avatar Eli Zaretskii
Browse files

(internal_equal): Return t for two NaN arguments.

parent d9c4f512
......@@ -2169,7 +2169,15 @@ internal_equal (o1, o2, depth)
switch (XTYPE (o1))
case Lisp_Float:
return (extract_float (o1) == extract_float (o2));
double d1, d2;
d1 = extract_float (o1);
d2 = extract_float (o2);
/* If d is a NaN, then d != d. Two NaNs should be `equal' even
though they are not =. */
return d1 == d2 || (d1 != d1 && d2 != d2);
case Lisp_Cons:
if (!internal_equal (XCAR (o1), XCAR (o2), depth + 1))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment