Skip to content
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

NaN > 0 and NaN == 0 #167

Closed
gopherbot opened this issue Nov 14, 2009 · 4 comments
Closed

NaN > 0 and NaN == 0 #167

gopherbot opened this issue Nov 14, 2009 · 4 comments

Comments

@gopherbot
Copy link
Contributor

by hnakamur:

What steps will reproduce the problem?

1. Run the attached file.

What is the expected output? What do you see instead?

It should print nothing.
Instead, it prints:
NaN > 0 is true, should be false.
NaN == 0 is true, should be false.

What is your $GOOS?  $GOARCH?

$ env | egrep '(GOOS|GOARCH)'
GOARCH=amd64
GOOS=darwin

Which revision are you sync'ed to?  (hg log -l 1)

$ env LANG=C hg log -l 1
changeset:   4037:cd0140653802
tag:         tip
user:        David Titarenco <david.titarenco@gmail.com>
date:        Fri Nov 13 18:06:47 2009 -0800
summary:     Created new Conn.Flush() public method so the fd pipeline 
can be drained arbitrarily by the user.

Please provide any additional information below.

Attachments:

  1. nan.go (286 bytes)
@gopherbot
Copy link
Contributor Author

Comment 1 by david.titarenco:

This is a pretty serious violation of IEEE-754.
More importantly (perhaps), NaN != NaN is a tautology that Go doesn't seem to respect.
if math.NaN() == math.NaN() {
     fmt.Println("NaN == NaN is true, should be false."); // This line is printed
}

@agl
Copy link
Contributor

agl commented Nov 14, 2009

Comment 2:

Status changed to Accepted.

@rsc
Copy link
Contributor

rsc commented Nov 16, 2009

Comment 3:

Owner changed to r...@golang.org.

Status changed to Started.

@rsc
Copy link
Contributor

rsc commented Nov 16, 2009

Comment 4:

This issue was closed by revision ef46a9d.

Status changed to Fixed.

Merged into issue #-.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
@rsc rsc removed their assignment Jun 22, 2022
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants