NA_t ==== .. cpp:class:: numpy::NA_t numpy C++ class. Example ------- .. code-block:: cpp #include using namespace numpy; // Use NA_t NA_t obj; // ... operations ... Other Methods ------------- .. list-table:: :widths: 40 20 15 25 :header-rows: 1 * - Signature - Return Type - Location - Example * - ``explicit constexpr operator bool() const noexcept`` - explicit constexpr operator - df_na.h:49 - :ref:`View ` * - ``std::string repr() const`` - constexpr bool operator>=(const T&) const noexcept { return false; } std::string - df_na.h:46 - Code Examples ------------- The following examples are extracted from the test suite. .. _example-na_t-bool-0: .. dropdown:: bool (np_test_4_all.cpp:1540) :class-title: example-dropdown .. code-block:: cpp :linenos: :lineno-start: 1530 :emphasize-lines: 11 // std::cout << " modf(uint64_t(100)) = (" << frac << ", " << integ << ") ✓\n"; } void test_scalar_bool() { std::cout << "Testing modf(bool_)...\n"; numpy::bool_ val_true = true; auto [frac1, integ1] = numpy::modf(val_true); static_assert(std::is_same_v, "bool_ should return double"); if (!(approx_equal(frac1, 0.0) && "bool(true) fractional part should be 0.0")) { std::string description = std::string("test_scalar_bool():") + __FILE__ + ":" + std::to_string(__LINE__) + ": !(approx_equal(frac1, 0.0) && \"bool(true) fractional part should be 0.0\")"; std::cout << std::string("[FAIL] ") + description << std::endl; throw std::runtime_error(description); } if (!(approx_equal(integ1, 1.0) && "bool(true) integer part should be 1.0")) { std::string description = std::string("test_scalar_bool():") + __FILE__ + ":" + std::to_string(__LINE__) + ": !(approx_equal(integ1, 1.0) && \"bool(true) integer part should be 1.0\")"; std::cout << std::string("[FAIL] ") + description << std::endl; throw std::runtime_error(description); }