sass/libsass

NaN and Infinity should not be equal to themselves

nex3 opened this issue · 2 comments

nex3 commented

For consistency with other Sass implementations, NaN (as returned by 0/0) and the positive and negative infinities (1/0 and -1/0) should not be equal to themselves.

Will probably be something in here

libsass/src/operators.cpp

Lines 154 to 157 in 97be6a3

if (op == Sass_OP::DIV && rval == 0) {
sass::string result(lval ? "Infinity" : "NaN");
return SASS_MEMORY_NEW(String_Quoted, pstate, result);
}

Is there a spec test for this?
Looks like latests 4.0 branch reports it correctly:

test {
    tst1: 1/0 == -1/0;
    tst3: -1/0 == 0/0;
    tst2: 1/0 == 0/0;
}

Expected result is false for all cases.