-
Notifications
You must be signed in to change notification settings - Fork 18k
spec: imprecise language around min and max when considering NaN #60570
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
Comments
CC @griesemer who wrote the spec update for this. |
NaN which stands for "Not a Number" is not a number, and thus arguably not a numeric argument... |
Change https://go.dev/cl/500416 mentions this issue: |
NaN is why we can't have nice things (and arguably floating point numbers
more generally)
…On Fri, Jun 2, 2023, 5:22 PM Robert Griesemer ***@***.***> wrote:
NaN which stands for "Not a Number" is not a number, and thus arguably not
a numeric argument...
—
Reply to this email directly, view it on GitHub
<#60570 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA4CUW4Q52M4O3FA4AYMMETXJIHNHANCNFSM6AAAAAAYYF4T5I>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
This is already covered in the text given, "For numeric arguments" which means NaN is not covered in that section. The next line after the original quoted text gives the chart:
Also |
Meh, my brain is clearly not up to speed as float64 is numeric and NaN is float64 so my last comment does not make sense. Sorry about the added confusion. |
Related oddity for |
The go spec at tip has the following language about min and max
In my reading, this is insufficiently precise. In particular,
min(math.NaN()) == min(math.NaN())
is false, so currently the spec is impossible to satisfy (cannot both propogate NaN and have those expressions be true). There should be a clarification around the interaction ofNaN
and==
.The text was updated successfully, but these errors were encountered: