1 Star 0 Fork 2

王布衣 / num

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
comparison.go 1.48 KB
一键复制 编辑 原始数据 按行查看 历史
王布衣 提交于 2024-02-12 09:23 . 调整package
package functions
import (
"gitee.com/quant1x/num/internal/constraints"
)
func Lt_Go[T constraints.Float](dst []bool, x, y []T) {
for i := 0; i < len(x); i++ {
dst[i] = x[i] < y[i]
}
}
func Lte_Go[T constraints.Float](dst []bool, x, y []T) {
for i := 0; i < len(x); i++ {
dst[i] = x[i] <= y[i]
}
}
func Gt_Go[T constraints.Float](dst []bool, x, y []T) {
for i := 0; i < len(x); i++ {
dst[i] = x[i] > y[i]
}
}
func Gte_Go[T constraints.Float](dst []bool, x, y []T) {
for i := 0; i < len(x); i++ {
dst[i] = x[i] >= y[i]
}
}
func Eq_Go[T constraints.Float](dst []bool, x, y []T) {
for i := 0; i < len(x); i++ {
dst[i] = x[i] == y[i]
}
}
func Neq_Go[T constraints.Float](dst []bool, x, y []T) {
for i := 0; i < len(x); i++ {
dst[i] = x[i] != y[i]
}
}
func LtNumber_Go[T constraints.Float](dst []bool, x []T, a T) {
for i := 0; i < len(x); i++ {
dst[i] = x[i] < a
}
}
func LteNumber_Go[T constraints.Float](dst []bool, x []T, a T) {
for i := 0; i < len(x); i++ {
dst[i] = x[i] <= a
}
}
func GtNumber_Go[T constraints.Float](dst []bool, x []T, a T) {
for i := 0; i < len(x); i++ {
dst[i] = x[i] > a
}
}
func GteNumber_Go[T constraints.Float](dst []bool, x []T, a T) {
for i := 0; i < len(x); i++ {
dst[i] = x[i] >= a
}
}
func EqNumber_Go[T constraints.Float](dst []bool, x []T, a T) {
for i := 0; i < len(x); i++ {
dst[i] = x[i] == a
}
}
func NeqNumber_Go[T constraints.Float](dst []bool, x []T, a T) {
for i := 0; i < len(x); i++ {
dst[i] = x[i] != a
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/quant1x/num.git
git@gitee.com:quant1x/num.git
quant1x
num
num
v0.3.2

搜索帮助

344bd9b3 5694891 D2dac590 5694891