| 227 | struct TanChecked { |
| 228 | template <typename T, typename Arg0> |
| 229 | static enable_if_floating_value<Arg0, T> Call(KernelContext*, Arg0 val, Status* st) { |
| 230 | static_assert(std::is_same<T, Arg0>::value, ""); |
| 231 | if (ARROW_PREDICT_FALSE(std::isinf(val))) { |
| 232 | *st = Status::Invalid("domain error"); |
| 233 | return val; |
| 234 | } |
| 235 | // Cannot raise range errors (overflow) since PI/2 is not exactly representable |
| 236 | return std::tan(val); |
| 237 | } |
| 238 | }; |
| 239 | |
| 240 | struct Tanh { |