Namespaces
Variants

std::numeric_limits<T>::has_infinity

From ko.cppreference.net
 
 
Utilities library
General utilities
Relational operators (deprecated in C++20)
Integer comparison functions
(C++20)(C++20)(C++20)    
(C++20)
Swap and type operations
(C++14)
(C++11)
(C++11)
(C++11)
(C++17)
Common vocabulary types
(C++11)
(C++17)
(C++17)
(C++17)
(C++11)
(C++17)
(C++23)



 
 
 
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.

Translate all user-facing natural language in the complete HTML fragment above to 한국어 (ko). The source contains exactly 253 immutable placeholders; return every one exactly once and in order. Return the complete translated text.

표준 특수화

T std:: numeric_limits < T > :: has_infinity 의 값
/* non-specialized */ false
bool false
char false
signed char false
unsigned char false
wchar_t false
char8_t (C++20부터) false
char16_t (C++11부터) false
char32_t (C++11부터) false
short false
unsigned short false
int false
unsigned int false
long false
unsigned long false
long long (C++11부터) false
unsigned long long (C++11부터) false
float 일반적으로 true
double 일반적으로 true
long double 일반적으로 true

예제

#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';
}

가능한 출력:

false
false
true
true

참고 항목

[static]
주어진 부동소수점 타입의 양의 무한대 값을 반환합니다
(public static member function)
특수 값 "quiet not-a-number"(NaN)을 표현할 수 있는 부동소수점 타입을 식별합니다
(public static member constant)
특수 값 "signaling not-a-number"(NaN)을 표현할 수 있는 부동소수점 타입을 식별합니다
(public static member constant)