-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Closed
Labels
FrozenDueToAgeNeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone
Description
go version go1.6 linux/amd64
m := map[float64]int{math.NaN(): 3, math.NaN(): 4, .1: 5}
fmt.Println(m)
prints map[0.1:5 NaN:<nil> NaN:<nil>].
I would have hoped for map[0.1:5 NaN:3 NaN:4] since for example iterating over the map with a for loop can retrieve the values 3 and 4. Perhaps acceptable would be map[0.1:5 NaN:0 NaN:0], consistent with v, ok := m[math.NaN()] returning 0, false. But printing when nil is not a valid value for the int type is unexpected.
bcmills
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeNeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.Feedback is required from experts, contributors, and/or the community before a change can be made.