feat(const_eval): impl. max

This commit is contained in:
Erich Gubler authored and Teodor Tanasoaia committed 2024-01-30 10:53:03 +01:00
1 parent 18f50092a6
commit abcc6ddff3
2 files changed
+6

No files matched your search

+1
View File
@@ -80,6 +80,7 @@ Bottom level categories:
- `inverseSqrt`
- `log`
- `log2`
- `max`
- `radians`
- `reverseBits`
- `sign`
+5
View File
@@ -956,6 +956,11 @@ impl<'a> ConstantEvaluator<'a> {
crate::MathFunction::Log2 => {
component_wise_float!(self, span, [arg], |e| { Ok([e.log2()]) })
}
crate::MathFunction::Max => {
component_wise_scalar!(self, span, [arg, arg1.unwrap()], |e1, e2| {
Ok([e1.max(e2)])
})
}
crate::MathFunction::Radians => {
component_wise_float!(self, span, [arg], |e1| { Ok([e1.to_radians()]) })
}