(t *testing.T)
| 91 | } |
| 92 | |
| 93 | func 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 | } |