SpECTRE Documentation Coverage Report
Current view: top level - Utilities - MakeSignalingNan.hpp Hit Total Coverage
Commit: 817e13c5144619b701c7cd870655d8dbf94ab8ce Lines: 3 4 75.0 %
Date: 2024-07-19 22:17:05
Legend: Lines: hit not hit

          Line data    Source code
       1           0 : // Distributed under the MIT License.
       2             : // See LICENSE.txt for details.
       3             : 
       4             : #pragma once
       5             : 
       6             : #include <limits>
       7             : 
       8             : /// @{
       9             : /// \ingroup UtilitiesGroup
      10             : /// \brief Returns an appropriate signaling NaN for fundamantal or multi-field
      11             : /// types (such as `std::complex`).
      12             : template <typename T>
      13           1 : T make_signaling_NaN(const T& /*meta*/) {
      14             :   return std::numeric_limits<T>::signaling_NaN();
      15             : }
      16             : 
      17             : template <typename T>
      18           1 : std::complex<T> make_signaling_NaN(const std::complex<T>& /*meta*/) {
      19             :   return {std::numeric_limits<T>::signaling_NaN(),
      20             :           std::numeric_limits<T>::signaling_NaN()};
      21             : }
      22             : 
      23             : template <typename T>
      24           1 : T make_signaling_NaN() {
      25             :   return make_signaling_NaN(static_cast<T>(0));
      26             : }
      27             : /// @}

Generated by: LCOV version 1.14