math: fix Shared VecN comparison operators (#1419)
This commit is contained in:
parent
af1cf9865b
commit
7cd7dce007
1 changed files with 8 additions and 8 deletions
|
|
@ -322,23 +322,23 @@ pub fn VecShared(comptime Scalar: type, comptime VecN: type) type {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Element-wise a < b
|
/// Element-wise a < b
|
||||||
pub inline fn less(a: *const VecN, b: Scalar) bool {
|
pub inline fn less(a: *const VecN, b: *const VecN) bool {
|
||||||
return a.v < b.v;
|
return @reduce(.And, a.v < b.v);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Element-wise a <= b
|
/// Element-wise a <= b
|
||||||
pub inline fn lessEq(a: *const VecN, b: Scalar) bool {
|
pub inline fn lessEq(a: *const VecN, b: *const VecN) bool {
|
||||||
return a.v <= b.v;
|
return @reduce(.And, a.v <= b.v);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Element-wise a > b
|
/// Element-wise a > b
|
||||||
pub inline fn greater(a: *const VecN, b: Scalar) bool {
|
pub inline fn greater(a: *const VecN, b: *const VecN) bool {
|
||||||
return a.v > b.v;
|
return @reduce(.And, a.v > b.v);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Element-wise a >= b
|
/// Element-wise a >= b
|
||||||
pub inline fn greaterEq(a: *const VecN, b: Scalar) bool {
|
pub inline fn greaterEq(a: *const VecN, b: *const VecN) bool {
|
||||||
return a.v >= b.v;
|
return @reduce(.And, a.v >= b.v);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns a vector with all components set to the `scalar` value:
|
/// Returns a vector with all components set to the `scalar` value:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue