File tree Expand file tree Collapse file tree 1 file changed +46
-1
lines changed Expand file tree Collapse file tree 1 file changed +46
-1
lines changed Original file line number Diff line number Diff line change 88```
99
1010## 概要
11- [`int_fast16_t`](int_fast16_t.md) の最小値。
11+ [`int_fast16_t`](int_fast16_t.md) の最小値を表す定数。
12+
13+ [`std::numeric_limits`](/reference/limits/numeric_limits.md)`<int_fast16_t>::`[`min()`](/reference/limits/numeric_limits/min.md) と等しい。
14+
15+ ## 例
16+ ```cpp example
17+ #include <iostream>
18+ #include <cstdint>
19+ #include <limits>
20+
21+ int main()
22+ {
23+ std::cout << "INT_FAST16_MIN: " << INT_FAST16_MIN << std::endl;
24+
25+ // numeric_limitsによる値と一致することを確認
26+ std::cout << "numeric_limits<int_fast16_t>::min(): "
27+ << std::numeric_limits<std::int_fast16_t>::min() << std::endl;
28+
29+ std::cout << "INT_FAST16_MIN == numeric_limits<int_fast16_t>::min(): "
30+ << std::boolalpha
31+ << (INT_FAST16_MIN == std::numeric_limits<std::int_fast16_t>::min()) << std::endl;
32+
33+ // 型の確認
34+ std::int_fast16_t min_value = INT_FAST16_MIN;
35+ std::cout << "型を通したときの値: " << min_value << std::endl;
36+
37+ // アンダーフローの確認
38+ std::int_fast16_t value = INT_FAST16_MIN;
39+ std::cout << "INT_FAST16_MIN: " << value << std::endl;
40+ std::cout << "INT_FAST16_MIN - 1: " << value - 1 << std::endl;
41+
42+ return 0;
43+ }
44+ ```
45+
46+ ### 出力例
47+ ```
48+ INT_FAST16_MIN: -32768
49+ numeric_limits<int_fast16_t>::min(): -32768
50+ INT_FAST16_MIN == numeric_limits<int_fast16_t>::min(): true
51+ 型を通したときの値: -32768
52+ INT_FAST16_MIN: -32768
53+ INT_FAST16_MIN - 1: 32767
54+ ```
55+
56+ この出力例は処理系によって異なる場合がある。特に、`int_fast16_t`の実際の型が処理系によって異なる可能性があるため、最小値やアンダーフロー動作も異なることがある。
1257
1358## バージョン
1459### 言語
You can’t perform that action at this time.
0 commit comments