-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Editorial: remove unhelpful and potentially misleading checks in Number::lessThan #3174
Conversation
I thought the outcome of editor call was that these are helpful? In particular, the only reason you could possibly be looking at this AO is because you want to know how edge cases are handled, and comparing |
It's really clear that zeroes are neither NaNs nor Infinities so they fall into the to-real case which has obvious semantics. I'll add back to editor call. |
My recollection of the discussion was indeed that they're helpful and should be kept, despite being redundant. |
The plan was that I would look at other similar guards in other AOs and compare the usefulness, and open this PR if I felt that this case provided less value than the other cases, which I feel it does. |
"both zero, with different signs" is a case that does not to me have obvious semantics in the "reals" scenario, and it's very helpful to me to have them treated specially, even though they technically don't need to be. |
I don't believe you. Both float zeroes convert to the single unsigned real zero. |
It is wildly unintuitive to me that |
Yes, but that's not what we're talking about here. We're talking about someone reading the spec steps of |
You have to do a lot more work to find the answer after these changes. |
It is also my recollection that the outcome of the editor call we keep these. |
As discussed in editor call. Noticed during review of #3169. These checks for zero don't provide anything in terms of readability. The other unnecessary checks of this form in Number::sameValue are helpful for comparison to Number::sameValueZero, and should remain.
Aside: I would maybe also add an emu-note to this AO that says something like "+∞𝔽 is not strictly less than any Number; no Number is strictly less than -∞𝔽" since inferring this from the sequence of steps handling infinities is harder than reading such a declaration.