| 491 | struct Logb { |
| 492 | template <typename T, typename Arg0, typename Arg1> |
| 493 | static enable_if_floating_value<T> Call(KernelContext*, Arg0 x, Arg1 base, Status*) { |
| 494 | static_assert(std::is_same<T, Arg0>::value, ""); |
| 495 | static_assert(std::is_same<Arg0, Arg1>::value, ""); |
| 496 | if (x == 0.0) { |
| 497 | if (base == 0.0 || base < 0.0) { |
| 498 | return std::numeric_limits<T>::quiet_NaN(); |
| 499 | } else { |
| 500 | return -std::numeric_limits<T>::infinity(); |
| 501 | } |
| 502 | } else if (x < 0.0) { |
| 503 | return std::numeric_limits<T>::quiet_NaN(); |
| 504 | } |
| 505 | return std::log(x) / std::log(base); |
| 506 | } |
| 507 | }; |
| 508 | |
| 509 | struct LogbChecked { |
nothing calls this directly
no outgoing calls
no test coverage detected