MCPcopy Create free account
hub / github.com/apache/fory / Equal

Method Equal

go/fory/float16/float16.go:322–334  ·  view source on GitHub ↗

Comparison

(other Float16)

Source from the content-addressed store, hash-verified

320// Comparison
321
322func (f Float16) Equal(other Float16) bool {
323 // IEEE 754: NaN != NaN
324 if f.IsNaN() || other.IsNaN() {
325 return false
326 }
327 // +0 == -0
328 if f.IsZero() && other.IsZero() {
329 return true
330 }
331 // Direct bit comparison works for typical normals with same sign
332 // But mixed signs or negative numbers need caear
333 return f.Float32() == other.Float32()
334}
335
336func (f Float16) Less(other Float16) bool {
337 if f.IsNaN() || other.IsNaN() {

Callers 15

TestBFloat16_ConversionFunction · 0.45
TestBFloat16_RoundingFunction · 0.45
TestForyFunction · 0.45
TestSerializeAnyFunction · 0.45
TestDeserializeFunction · 0.45
TestGlobalFunctionsFunction · 0.45
TestFloat16_ConversionFunction · 0.45
TestFloat16_NaNFunction · 0.45
TestFloat16_ArithmeticFunction · 0.45
TestMetaStringResolverFunction · 0.45
TestValidationDemoFunction · 0.45
TestDynamicSliceDemoFunction · 0.45

Calls 3

IsNaNMethod · 0.95
IsZeroMethod · 0.95
Float32Method · 0.95

Tested by 15

TestBFloat16_ConversionFunction · 0.36
TestBFloat16_RoundingFunction · 0.36
TestForyFunction · 0.36
TestSerializeAnyFunction · 0.36
TestDeserializeFunction · 0.36
TestGlobalFunctionsFunction · 0.36
TestFloat16_ConversionFunction · 0.36
TestFloat16_NaNFunction · 0.36
TestFloat16_ArithmeticFunction · 0.36
TestMetaStringResolverFunction · 0.36
TestValidationDemoFunction · 0.36
TestDynamicSliceDemoFunction · 0.36