2 Star 2 Fork 9

王布衣/gox

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
comparison.go 1.46 KB
一键复制 编辑 原始数据 按行查看 历史
王布衣 提交于 2023-06-03 06:07 . 调整vek目录为num
package functions
import (
"golang.org/x/exp/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/gox.git
git@gitee.com:quant1x/gox.git
quant1x
gox
gox
v1.14.8

搜索帮助