Description
This is behaviour that also surprised me about Go that I did not know about, but apparently, because NaN != NaN
, then you can have multiple NaN's as keys in a single map.
In Gno, this leads to a panic due to having duplicate keys.
package main
import (
"fmt"
"math"
)
var NaN = math.NaN()
func main() {
fmt.Println(map[float64]int{NaN: 1, NaN: 2})
}
Metadata
Metadata
Labels
Type
Projects
Status
In Progress