名稱空間
變體
操作

std::numeric_limits<T>::is_exact

來自 cppreference.com
< cpp‎ | 型別‎ | 數值限制
 
 
 
 
 
static const bool is_exact;
(C++11 前)
static constexpr bool is_exact;
(C++11 起)

std::numeric_limits<T>::is_exact 的值對於所有使用精確表示的算術型別 T 都是 true

[編輯] 標準特化

T std::numeric_limits<T>::is_exact 的值
/* 未特化 */ false
bool true
char true
signed char true
unsigned char true
wchar_t true
char8_t (C++20起) true
char16_t (C++11起) true
char32_t (C++11起) true
short true
unsigned short true
int true
unsigned int true
long true
unsigned long true
long long (C++11起) true
unsigned long long (C++11起) true
float false
double false
long double false

[編輯] 注意

雖然所有基本型別 T,如果 std::numeric_limits<T>::is_exact == true,都是整數型別,但庫可以定義非整數的精確型別,例如表示分數的有理算術型別。

[編輯] 參閱

[靜態]
確定整數型別
(public static 成員常量) [編輯]
[靜態]
確定有符號型別
(public static 成員常量) [編輯]
[靜態]
確定表示有限值集合的型別
(public static 成員常量) [編輯]