'Float64 Less() implementation in standard Go library

I've been digging in 'sort' package of standard Go library, studying concrete implementations of used sorting algorithms and one thing seems really strange to me - definition of Float64 Less() function:

func (x Float64Slice) Less(i, j int) bool { return x[i] < x[j] || (isNaN(x[i]) && !isNaN(x[j])) }

I quite confident, that floating-point values (in IEEE 754 semantics, at least) MUST NOT be compared directly. Why the comparison implemented this way is in standard Go lib?

go


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source