Files
go-easy-utils/mathUtil/floor_test.go
jeffery f97913a2bc Feature/math util (#22)
Development supports the math package
2023-04-12 11:10:07 +08:00

22 lines
377 B
Go

package mathUtil
import "testing"
func TestFloorFloat32(t *testing.T) {
var input float32 = -12.4
var expected int = -13
res := Floor(input)
if res != expected {
t.Errorf("floor error %d", res)
}
}
func TestFloorFloat64(t *testing.T) {
var input float64 = 12.4
var expected int = 12
res := Floor(input)
if res != expected {
t.Errorf("floor error %d", res)
}
}