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

Function TestFloat16_NaN

go/fory/float16/float16_test.go:79–91  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

77}
78
79func TestFloat16_NaN(t *testing.T) {
80 nan := float16.NaN
81 assert.True(t, nan.IsNaN())
82 assert.False(t, nan.IsInf(0))
83 assert.False(t, nan.IsZero())
84
85 // Comparison
86 assert.False(t, nan.Equal(nan))
87
88 // Conversion
89 f32 := nan.Float32()
90 assert.True(t, math.IsNaN(float64(f32)))
91}
92
93func TestFloat16_Arithmetic(t *testing.T) {
94 one := float16.Float16FromFloat32(1.0)

Callers

nothing calls this directly

Calls 6

IsNaNMethod · 0.80
IsInfMethod · 0.80
IsZeroMethod · 0.80
float64Function · 0.50
EqualMethod · 0.45
Float32Method · 0.45

Tested by

no test coverage detected