std::numeri...has_infinity(3)
πΈ NAME πΈ
okay so this is the std::numeri...has_infinity(3) page β from the C++ Standard Libary manual, section 3, bestie π and we are talking about std::numeric_limits::has_infinity, no cap.
std::numeric_limits::has_infinity β std::numeric_limits::has_infinity
π¦ Synopsis π¦
static const bool has_infinity; (until C++11)
static constexpr bool has_infinity; (since C++11)
The value of std::numeric_limits<T>::has_infinity is true for all types T capable of representing the positive infinity as a distinct special value. This constant is meaningful for all floating-point types and is guaranteed to be true if std::numeric_limits<T>::is_iec559 == true.
π¦ Standard specializations π¦
hereβs the T β value of std::numeric_limits<T>::has_infinity vibe check, bestie π
/* non-specialized */βfalseboolβfalsecharβfalsesigned charβfalseunsigned charβfalsewchar_tβfalsechar8_t(since C++20) βfalsechar16_t(since C++11) βfalsechar32_t(since C++11) βfalseshortβfalseunsigned shortβfalseintβfalseunsigned intβfalselongβfalseunsigned longβfalselong long(since C++11) βfalseunsigned long long(since C++11) βfalsefloatβ usuallytruedoubleβ usuallytruelong doubleβ usuallytrue
π Example π
// Run this code
#include <iostream>
#include <limits>
int main()
{
std::cout << std::boolalpha
<< std::numeric_limits<int>::has_infinity << '\n'
<< std::numeric_limits<long>::has_infinity << '\n'
<< std::numeric_limits<float>::has_infinity << '\n'
<< std::numeric_limits<double>::has_infinity << '\n';
}
π Possible output π
false
false
true
true
π See also π
infinity[static]β returns the positive infinity value of the given floating-point type (public static member function)has_quiet_NaN[static]β identifies floating-point types that can represent the special value "quiet not-a-number" (NaN) (public static member constant)has_signaling_NaN[static]β identifies floating-point types that can represent the special value "signaling not-a-number" (NaN) (public static member constant)
mwah π this cutie came from http://cppreference.com, dated 2024.06.10 β and the page is std::numeri...has_infinity(3) β bye bestie π«Άβ¨
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms