1 Star 3 Fork 6

王布衣/num

Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
logic_equal.go 711 Bytes
Copy Edit Raw Blame History
王布衣 authored 2025-09-14 21:50 +08:00 . 更新依赖库版本
package num
import (
"gitee.com/quant1x/num/x32"
"gitee.com/quant1x/num/x64"
)
// Equal 比较相等
func Equal[T BaseType](x, y []T) []bool {
return BinaryOperations2[T, bool](x, y, x32.Eq, x64.Eq, __eq_go[T])
}
func __eq_go[T BaseType](x, y []T) []bool {
length := len(x)
d := make([]bool, length)
for i := 0; i < length; i++ {
if x[i] == y[i] {
d[i] = true
}
}
return d
}
// NotEqual 不相等
func NotEqual[T BaseType](x, y []T) []bool {
return BinaryOperations2[T, bool](x, y, x32.Neq, x64.Neq, __neq_go[T])
}
func __neq_go[T BaseType](x, y []T) []bool {
length := len(x)
d := make([]bool, length)
for i := 0; i < length; i++ {
if x[i] != y[i] {
d[i] = true
}
}
return d
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/quant1x/num.git
git@gitee.com:quant1x/num.git
quant1x
num
num
v0.7.15

Search