libsass icon indicating copy to clipboard operation
libsass copied to clipboard

NaN and Infinity should not be equal to themselves

Open nex3 opened this issue 3 years ago • 2 comments

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.

nex3 avatar Sep 04 '20 22:09 nex3

Will probably be something in here https://github.com/sass/libsass/blob/97be6a334b9512108076041247cbd0ec114aee5d/src/operators.cpp#L154-L157

nschonni avatar Sep 05 '20 02:09 nschonni

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.

mgreter avatar Mar 04 '21 05:03 mgreter