mirror of
https://github.com/jefferyjob/go-easy-utils.git
synced 2025-10-05 23:16:50 +08:00
24 lines
360 B
Go
24 lines
360 B
Go
package mathUtil
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestCeilFloat32(t *testing.T) {
|
|
var input float32 = -12.4
|
|
var expected int = -12
|
|
res := Ceil(input)
|
|
if res != expected {
|
|
t.Errorf("ceil error")
|
|
}
|
|
}
|
|
|
|
func TestCeilFloat64(t *testing.T) {
|
|
var input float64 = 12.4
|
|
var expected int = 13
|
|
res := Ceil(input)
|
|
if res != expected {
|
|
t.Errorf("ceil error")
|
|
}
|
|
}
|