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

Function TestFloat16_Arithmetic

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

Source from the content-addressed store, hash-verified

91}
92
93func TestFloat16_Arithmetic(t *testing.T) {
94 one := float16.Float16FromFloat32(1.0)
95 two := float16.Float16FromFloat32(2.0)
96 three := float16.Float16FromFloat32(3.0)
97
98 assert.Equal(t, "3", one.Add(two).String())
99 assert.Equal(t, "2", three.Sub(one).String())
100 assert.Equal(t, "6", two.Mul(three).String())
101 assert.Equal(t, "1.5", three.Div(two).String())
102}

Callers

nothing calls this directly

Calls 6

SubMethod · 0.80
MulMethod · 0.80
DivMethod · 0.80
EqualMethod · 0.45
StringMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected