| 435 | struct Log2 { |
| 436 | template <typename T, typename Arg> |
| 437 | static enable_if_floating_value<Arg, T> Call(KernelContext*, Arg arg, Status*) { |
| 438 | static_assert(std::is_same<T, Arg>::value, ""); |
| 439 | if (arg == 0.0) { |
| 440 | return -std::numeric_limits<T>::infinity(); |
| 441 | } else if (arg < 0.0) { |
| 442 | return std::numeric_limits<T>::quiet_NaN(); |
| 443 | } |
| 444 | return std::log2(arg); |
| 445 | } |
| 446 | }; |
| 447 | |
| 448 | struct Log2Checked { |
nothing calls this directly
no outgoing calls
no test coverage detected