|
|
@ -66,7 +66,14 @@ func (Decimal) pointLength(a any) int {
|
|
|
|
|
|
|
|
|
|
|
|
// IsInteger 是否为整数
|
|
|
|
// IsInteger 是否为整数
|
|
|
|
func (d Decimal) IsInteger(d2 float64) bool {
|
|
|
|
func (d Decimal) IsInteger(d2 float64) bool {
|
|
|
|
f3 := NewFloat(d.Float64()).QuoFloat(NewFloat(d2).Float64()).Float64()
|
|
|
|
if d2 > 0 {
|
|
|
|
|
|
|
|
f3 := NewFloat(d.Float64()).QuoFloat(NewFloat(d2).Float64()).Float64()
|
|
|
|
|
|
|
|
if f3 == math.Trunc(f3) {
|
|
|
|
|
|
|
|
return true
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return false
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
f3 := NewFloat(d.Float64()).Float64()
|
|
|
|
if f3 == math.Trunc(f3) {
|
|
|
|
if f3 == math.Trunc(f3) {
|
|
|
|
return true
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
}
|
|
|
|