feat(const_eval): impl. cosh

This commit is contained in:
Erich Gubler committed 2024-01-18 16:57:46 -05:00
1 parent 7528b22e57
commit 12b11f870b
2 files changed
+4

No files matched your search

+1
View File
@@ -45,6 +45,7 @@ Bottom level categories:
- [#4879](https://github.com/gfx-rs/wgpu/pull/4879) by @ErichDonGubler:
- `abs`
- `cos`
- `cosh`
- `round`
- `saturate`
- `sin`
+3
View File
@@ -837,6 +837,9 @@ impl<'a> ConstantEvaluator<'a> {
crate::MathFunction::Cos => {
component_wise_float!(self, span, [arg], |e| { Ok([e.cos()]) })
}
crate::MathFunction::Cosh => {
component_wise_float!(self, span, [arg], |e| { Ok([e.cosh()]) })
}
crate::MathFunction::Round => {
// TODO: Use `f{32,64}.round_ties_even()` when available on stable. This polyfill
// is shamelessly [~~stolen from~~ inspired by `ndarray-image`][polyfill source],