mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-06 18:10:25 +08:00
优化代码/删除不需要的代码
This commit is contained in:
@@ -4,6 +4,7 @@ package numberutils_test
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAPI/internal/utils/numberutils"
|
||||
"math"
|
||||
"testing"
|
||||
)
|
||||
|
||||
@@ -18,3 +19,16 @@ func TestMin(t *testing.T) {
|
||||
t.Log(numberutils.Min[int32](1, 2, 3))
|
||||
t.Log(numberutils.Min[float32](1.2, 2.3, 3.4))
|
||||
}
|
||||
|
||||
func TestMaxFloat32(t *testing.T) {
|
||||
t.Logf("%f", math.MaxFloat32/(1<<100))
|
||||
}
|
||||
|
||||
func TestFloorFloat32(t *testing.T) {
|
||||
t.Logf("%f", numberutils.FloorFloat32(123.456, -1))
|
||||
t.Logf("%f", numberutils.FloorFloat32(123.456, 0))
|
||||
t.Logf("%f, %f", numberutils.FloorFloat32(123.456, 1), 123.456*10)
|
||||
t.Logf("%f, %f", numberutils.FloorFloat32(123.456, 2), 123.456*10*10)
|
||||
t.Logf("%f, %f", numberutils.FloorFloat32(123.456, 3), 123.456*10*10*10)
|
||||
t.Logf("%f, %f", numberutils.FloorFloat32(123.456, 4), 123.456*10*10*10*10)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user