tmp/tmpl1fw9do8/{from.md → to.md}
RENAMED
|
@@ -1,14 +1,17 @@
|
|
| 1 |
#### `numeric_limits` members <a id="numeric.limits.members">[[numeric.limits.members]]</a>
|
| 2 |
|
|
|
|
|
|
|
|
|
|
| 3 |
``` cpp
|
| 4 |
static constexpr T min() noexcept;
|
| 5 |
```
|
| 6 |
|
| 7 |
Minimum finite value.[^3]
|
| 8 |
|
| 9 |
-
For floating types with
|
| 10 |
normalized value.
|
| 11 |
|
| 12 |
Meaningful for all specializations in which `is_bounded != false`, or
|
| 13 |
`is_bounded == false && is_signed == false`.
|
| 14 |
|
|
@@ -35,11 +38,11 @@ static constexpr int digits;
|
|
| 35 |
|
| 36 |
Number of `radix` digits that can be represented without change.
|
| 37 |
|
| 38 |
For integer types, the number of non-sign bits in the representation.
|
| 39 |
|
| 40 |
-
For floating
|
| 41 |
mantissa.[^6]
|
| 42 |
|
| 43 |
``` cpp
|
| 44 |
static constexpr int digits10;
|
| 45 |
```
|
|
@@ -53,33 +56,33 @@ static constexpr int max_digits10;
|
|
| 53 |
```
|
| 54 |
|
| 55 |
Number of base 10 digits required to ensure that values which differ are
|
| 56 |
always differentiated.
|
| 57 |
|
| 58 |
-
Meaningful for all floating
|
| 59 |
|
| 60 |
``` cpp
|
| 61 |
static constexpr bool is_signed;
|
| 62 |
```
|
| 63 |
|
| 64 |
-
|
| 65 |
|
| 66 |
Meaningful for all specializations.
|
| 67 |
|
| 68 |
``` cpp
|
| 69 |
static constexpr bool is_integer;
|
| 70 |
```
|
| 71 |
|
| 72 |
-
|
| 73 |
|
| 74 |
Meaningful for all specializations.
|
| 75 |
|
| 76 |
``` cpp
|
| 77 |
static constexpr bool is_exact;
|
| 78 |
```
|
| 79 |
|
| 80 |
-
|
| 81 |
exact, but not all exact types are integer. For example, rational and
|
| 82 |
fixed-exponent representations are exact but not integer.
|
| 83 |
|
| 84 |
Meaningful for all specializations.
|
| 85 |
|
|
@@ -99,11 +102,11 @@ static constexpr T epsilon() noexcept;
|
|
| 99 |
```
|
| 100 |
|
| 101 |
Machine epsilon: the difference between 1 and the least value greater
|
| 102 |
than 1 that is representable.[^10]
|
| 103 |
|
| 104 |
-
Meaningful for all floating
|
| 105 |
|
| 106 |
``` cpp
|
| 107 |
static constexpr T round_error() noexcept;
|
| 108 |
```
|
| 109 |
|
|
@@ -112,89 +115,89 @@ Measure of the maximum rounding error.[^11]
|
|
| 112 |
``` cpp
|
| 113 |
static constexpr int min_exponent;
|
| 114 |
```
|
| 115 |
|
| 116 |
Minimum negative integer such that `radix` raised to the power of one
|
| 117 |
-
less than that integer is a normalized floating
|
| 118 |
|
| 119 |
-
Meaningful for all floating
|
| 120 |
|
| 121 |
``` cpp
|
| 122 |
static constexpr int min_exponent10;
|
| 123 |
```
|
| 124 |
|
| 125 |
Minimum negative integer such that 10 raised to that power is in the
|
| 126 |
-
range of normalized floating
|
| 127 |
|
| 128 |
-
Meaningful for all floating
|
| 129 |
|
| 130 |
``` cpp
|
| 131 |
static constexpr int max_exponent;
|
| 132 |
```
|
| 133 |
|
| 134 |
Maximum positive integer such that `radix` raised to the power one less
|
| 135 |
-
than that integer is a representable finite floating
|
| 136 |
|
| 137 |
-
Meaningful for all floating
|
| 138 |
|
| 139 |
``` cpp
|
| 140 |
static constexpr int max_exponent10;
|
| 141 |
```
|
| 142 |
|
| 143 |
Maximum positive integer such that 10 raised to that power is in the
|
| 144 |
-
range of representable finite floating
|
| 145 |
|
| 146 |
-
Meaningful for all floating
|
| 147 |
|
| 148 |
``` cpp
|
| 149 |
static constexpr bool has_infinity;
|
| 150 |
```
|
| 151 |
|
| 152 |
-
|
| 153 |
|
| 154 |
-
Meaningful for all floating
|
| 155 |
|
| 156 |
Shall be `true` for all specializations in which `is_iec559 != false`.
|
| 157 |
|
| 158 |
``` cpp
|
| 159 |
static constexpr bool has_quiet_NaN;
|
| 160 |
```
|
| 161 |
|
| 162 |
-
|
| 163 |
-
Number
|
| 164 |
|
| 165 |
-
Meaningful for all floating
|
| 166 |
|
| 167 |
Shall be `true` for all specializations in which `is_iec559 != false`.
|
| 168 |
|
| 169 |
``` cpp
|
| 170 |
static constexpr bool has_signaling_NaN;
|
| 171 |
```
|
| 172 |
|
| 173 |
-
|
| 174 |
-
Number
|
| 175 |
|
| 176 |
-
Meaningful for all floating
|
| 177 |
|
| 178 |
Shall be `true` for all specializations in which `is_iec559 != false`.
|
| 179 |
|
| 180 |
``` cpp
|
| 181 |
static constexpr float_denorm_style has_denorm;
|
| 182 |
```
|
| 183 |
|
| 184 |
-
`denorm_present` if the type allows
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
|
| 189 |
-
Meaningful for all floating
|
| 190 |
|
| 191 |
``` cpp
|
| 192 |
static constexpr bool has_denorm_loss;
|
| 193 |
```
|
| 194 |
|
| 195 |
-
|
| 196 |
than as an inexact result.[^19]
|
| 197 |
|
| 198 |
``` cpp
|
| 199 |
static constexpr T infinity() noexcept;
|
| 200 |
```
|
|
@@ -206,65 +209,70 @@ Required in specializations for which `is_iec559 != false`.
|
|
| 206 |
|
| 207 |
``` cpp
|
| 208 |
static constexpr T quiet_NaN() noexcept;
|
| 209 |
```
|
| 210 |
|
| 211 |
-
Representation of a quiet “Not a Number
|
| 212 |
|
| 213 |
Meaningful for all specializations for which `has_quiet_NaN != false`.
|
| 214 |
Required in specializations for which `is_iec559 != false`.
|
| 215 |
|
| 216 |
``` cpp
|
| 217 |
static constexpr T signaling_NaN() noexcept;
|
| 218 |
```
|
| 219 |
|
| 220 |
-
Representation of a signaling “Not a Number
|
| 221 |
|
| 222 |
Meaningful for all specializations for which
|
| 223 |
`has_signaling_NaN != false`. Required in specializations for which
|
| 224 |
`is_iec559 != false`.
|
| 225 |
|
| 226 |
``` cpp
|
| 227 |
static constexpr T denorm_min() noexcept;
|
| 228 |
```
|
| 229 |
|
| 230 |
-
Minimum positive
|
| 231 |
|
| 232 |
-
Meaningful for all floating
|
| 233 |
|
| 234 |
In specializations for which `has_denorm == false`, returns the minimum
|
| 235 |
positive normalized value.
|
| 236 |
|
| 237 |
``` cpp
|
| 238 |
static constexpr bool is_iec559;
|
| 239 |
```
|
| 240 |
|
| 241 |
-
|
| 242 |
|
| 243 |
-
Meaningful for all floating
|
| 244 |
|
| 245 |
``` cpp
|
| 246 |
static constexpr bool is_bounded;
|
| 247 |
```
|
| 248 |
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
|
|
|
|
|
|
| 252 |
|
| 253 |
Meaningful for all specializations.
|
| 254 |
|
| 255 |
``` cpp
|
| 256 |
static constexpr bool is_modulo;
|
| 257 |
```
|
| 258 |
|
| 259 |
-
|
| 260 |
-
involving `+`, `-`, or `*` on values of that type whose result
|
| 261 |
-
fall outside the range \[`min()`, `max()`\], the value returned
|
| 262 |
-
from the true value by an integer multiple of
|
|
|
|
| 263 |
|
| 264 |
-
|
| 265 |
-
|
|
|
|
|
|
|
| 266 |
|
| 267 |
Meaningful for all specializations.
|
| 268 |
|
| 269 |
``` cpp
|
| 270 |
static constexpr bool traps;
|
|
@@ -279,16 +287,16 @@ Meaningful for all specializations.
|
|
| 279 |
static constexpr bool tinyness_before;
|
| 280 |
```
|
| 281 |
|
| 282 |
`true` if tinyness is detected before rounding.[^28]
|
| 283 |
|
| 284 |
-
Meaningful for all floating
|
| 285 |
|
| 286 |
``` cpp
|
| 287 |
static constexpr float_round_style round_style;
|
| 288 |
```
|
| 289 |
|
| 290 |
The rounding style for the type.[^29]
|
| 291 |
|
| 292 |
-
Meaningful for all floating
|
| 293 |
types shall return `round_toward_zero`.
|
| 294 |
|
|
|
|
| 1 |
#### `numeric_limits` members <a id="numeric.limits.members">[[numeric.limits.members]]</a>
|
| 2 |
|
| 3 |
+
Each member function defined in this subclause is signal-safe (
|
| 4 |
+
[[csignal.syn]]).
|
| 5 |
+
|
| 6 |
``` cpp
|
| 7 |
static constexpr T min() noexcept;
|
| 8 |
```
|
| 9 |
|
| 10 |
Minimum finite value.[^3]
|
| 11 |
|
| 12 |
+
For floating types with subnormal numbers, returns the minimum positive
|
| 13 |
normalized value.
|
| 14 |
|
| 15 |
Meaningful for all specializations in which `is_bounded != false`, or
|
| 16 |
`is_bounded == false && is_signed == false`.
|
| 17 |
|
|
|
|
| 38 |
|
| 39 |
Number of `radix` digits that can be represented without change.
|
| 40 |
|
| 41 |
For integer types, the number of non-sign bits in the representation.
|
| 42 |
|
| 43 |
+
For floating-point types, the number of `radix` digits in the
|
| 44 |
mantissa.[^6]
|
| 45 |
|
| 46 |
``` cpp
|
| 47 |
static constexpr int digits10;
|
| 48 |
```
|
|
|
|
| 56 |
```
|
| 57 |
|
| 58 |
Number of base 10 digits required to ensure that values which differ are
|
| 59 |
always differentiated.
|
| 60 |
|
| 61 |
+
Meaningful for all floating-point types.
|
| 62 |
|
| 63 |
``` cpp
|
| 64 |
static constexpr bool is_signed;
|
| 65 |
```
|
| 66 |
|
| 67 |
+
`true` if the type is signed.
|
| 68 |
|
| 69 |
Meaningful for all specializations.
|
| 70 |
|
| 71 |
``` cpp
|
| 72 |
static constexpr bool is_integer;
|
| 73 |
```
|
| 74 |
|
| 75 |
+
`true` if the type is integer.
|
| 76 |
|
| 77 |
Meaningful for all specializations.
|
| 78 |
|
| 79 |
``` cpp
|
| 80 |
static constexpr bool is_exact;
|
| 81 |
```
|
| 82 |
|
| 83 |
+
`true` if the type uses an exact representation. All integer types are
|
| 84 |
exact, but not all exact types are integer. For example, rational and
|
| 85 |
fixed-exponent representations are exact but not integer.
|
| 86 |
|
| 87 |
Meaningful for all specializations.
|
| 88 |
|
|
|
|
| 102 |
```
|
| 103 |
|
| 104 |
Machine epsilon: the difference between 1 and the least value greater
|
| 105 |
than 1 that is representable.[^10]
|
| 106 |
|
| 107 |
+
Meaningful for all floating-point types.
|
| 108 |
|
| 109 |
``` cpp
|
| 110 |
static constexpr T round_error() noexcept;
|
| 111 |
```
|
| 112 |
|
|
|
|
| 115 |
``` cpp
|
| 116 |
static constexpr int min_exponent;
|
| 117 |
```
|
| 118 |
|
| 119 |
Minimum negative integer such that `radix` raised to the power of one
|
| 120 |
+
less than that integer is a normalized floating-point number.[^12]
|
| 121 |
|
| 122 |
+
Meaningful for all floating-point types.
|
| 123 |
|
| 124 |
``` cpp
|
| 125 |
static constexpr int min_exponent10;
|
| 126 |
```
|
| 127 |
|
| 128 |
Minimum negative integer such that 10 raised to that power is in the
|
| 129 |
+
range of normalized floating-point numbers.[^13]
|
| 130 |
|
| 131 |
+
Meaningful for all floating-point types.
|
| 132 |
|
| 133 |
``` cpp
|
| 134 |
static constexpr int max_exponent;
|
| 135 |
```
|
| 136 |
|
| 137 |
Maximum positive integer such that `radix` raised to the power one less
|
| 138 |
+
than that integer is a representable finite floating-point number.[^14]
|
| 139 |
|
| 140 |
+
Meaningful for all floating-point types.
|
| 141 |
|
| 142 |
``` cpp
|
| 143 |
static constexpr int max_exponent10;
|
| 144 |
```
|
| 145 |
|
| 146 |
Maximum positive integer such that 10 raised to that power is in the
|
| 147 |
+
range of representable finite floating-point numbers.[^15]
|
| 148 |
|
| 149 |
+
Meaningful for all floating-point types.
|
| 150 |
|
| 151 |
``` cpp
|
| 152 |
static constexpr bool has_infinity;
|
| 153 |
```
|
| 154 |
|
| 155 |
+
`true` if the type has a representation for positive infinity.
|
| 156 |
|
| 157 |
+
Meaningful for all floating-point types.
|
| 158 |
|
| 159 |
Shall be `true` for all specializations in which `is_iec559 != false`.
|
| 160 |
|
| 161 |
``` cpp
|
| 162 |
static constexpr bool has_quiet_NaN;
|
| 163 |
```
|
| 164 |
|
| 165 |
+
`true` if the type has a representation for a quiet (non-signaling) “Not
|
| 166 |
+
a Number”.[^16]
|
| 167 |
|
| 168 |
+
Meaningful for all floating-point types.
|
| 169 |
|
| 170 |
Shall be `true` for all specializations in which `is_iec559 != false`.
|
| 171 |
|
| 172 |
``` cpp
|
| 173 |
static constexpr bool has_signaling_NaN;
|
| 174 |
```
|
| 175 |
|
| 176 |
+
`true` if the type has a representation for a signaling “Not a
|
| 177 |
+
Number”.[^17]
|
| 178 |
|
| 179 |
+
Meaningful for all floating-point types.
|
| 180 |
|
| 181 |
Shall be `true` for all specializations in which `is_iec559 != false`.
|
| 182 |
|
| 183 |
``` cpp
|
| 184 |
static constexpr float_denorm_style has_denorm;
|
| 185 |
```
|
| 186 |
|
| 187 |
+
`denorm_present` if the type allows subnormal values (variable number of
|
| 188 |
+
exponent bits)[^18], `denorm_absent` if the type does not allow
|
| 189 |
+
subnormal values, and `denorm_indeterminate` if it is indeterminate at
|
| 190 |
+
compile time whether the type allows subnormal values.
|
| 191 |
|
| 192 |
+
Meaningful for all floating-point types.
|
| 193 |
|
| 194 |
``` cpp
|
| 195 |
static constexpr bool has_denorm_loss;
|
| 196 |
```
|
| 197 |
|
| 198 |
+
`true` if loss of accuracy is detected as a denormalization loss, rather
|
| 199 |
than as an inexact result.[^19]
|
| 200 |
|
| 201 |
``` cpp
|
| 202 |
static constexpr T infinity() noexcept;
|
| 203 |
```
|
|
|
|
| 209 |
|
| 210 |
``` cpp
|
| 211 |
static constexpr T quiet_NaN() noexcept;
|
| 212 |
```
|
| 213 |
|
| 214 |
+
Representation of a quiet “Not a Number”, if available.[^21]
|
| 215 |
|
| 216 |
Meaningful for all specializations for which `has_quiet_NaN != false`.
|
| 217 |
Required in specializations for which `is_iec559 != false`.
|
| 218 |
|
| 219 |
``` cpp
|
| 220 |
static constexpr T signaling_NaN() noexcept;
|
| 221 |
```
|
| 222 |
|
| 223 |
+
Representation of a signaling “Not a Number”, if available.[^22]
|
| 224 |
|
| 225 |
Meaningful for all specializations for which
|
| 226 |
`has_signaling_NaN != false`. Required in specializations for which
|
| 227 |
`is_iec559 != false`.
|
| 228 |
|
| 229 |
``` cpp
|
| 230 |
static constexpr T denorm_min() noexcept;
|
| 231 |
```
|
| 232 |
|
| 233 |
+
Minimum positive subnormal value.[^23]
|
| 234 |
|
| 235 |
+
Meaningful for all floating-point types.
|
| 236 |
|
| 237 |
In specializations for which `has_denorm == false`, returns the minimum
|
| 238 |
positive normalized value.
|
| 239 |
|
| 240 |
``` cpp
|
| 241 |
static constexpr bool is_iec559;
|
| 242 |
```
|
| 243 |
|
| 244 |
+
`true` if and only if the type adheres to ISO/IEC/IEEE 60559.[^24]
|
| 245 |
|
| 246 |
+
Meaningful for all floating-point types.
|
| 247 |
|
| 248 |
``` cpp
|
| 249 |
static constexpr bool is_bounded;
|
| 250 |
```
|
| 251 |
|
| 252 |
+
`true` if the set of values representable by the type is finite.[^25]
|
| 253 |
+
|
| 254 |
+
[*Note 1*: All fundamental types ([[basic.fundamental]]) are bounded.
|
| 255 |
+
This member would be `false` for arbitrary precision
|
| 256 |
+
types. — *end note*]
|
| 257 |
|
| 258 |
Meaningful for all specializations.
|
| 259 |
|
| 260 |
``` cpp
|
| 261 |
static constexpr bool is_modulo;
|
| 262 |
```
|
| 263 |
|
| 264 |
+
`true` if the type is modulo.[^26] A type is modulo if, for any
|
| 265 |
+
operation involving `+`, `-`, or `*` on values of that type whose result
|
| 266 |
+
would fall outside the range \[`min()`, `max()`\], the value returned
|
| 267 |
+
differs from the true value by an integer multiple of
|
| 268 |
+
`max() - min() + 1`.
|
| 269 |
|
| 270 |
+
[*Example 1*: `is_modulo` is `false` for signed integer
|
| 271 |
+
types ([[basic.fundamental]]) unless an implementation, as an extension
|
| 272 |
+
to this International Standard, defines signed integer overflow to
|
| 273 |
+
wrap. — *end example*]
|
| 274 |
|
| 275 |
Meaningful for all specializations.
|
| 276 |
|
| 277 |
``` cpp
|
| 278 |
static constexpr bool traps;
|
|
|
|
| 287 |
static constexpr bool tinyness_before;
|
| 288 |
```
|
| 289 |
|
| 290 |
`true` if tinyness is detected before rounding.[^28]
|
| 291 |
|
| 292 |
+
Meaningful for all floating-point types.
|
| 293 |
|
| 294 |
``` cpp
|
| 295 |
static constexpr float_round_style round_style;
|
| 296 |
```
|
| 297 |
|
| 298 |
The rounding style for the type.[^29]
|
| 299 |
|
| 300 |
+
Meaningful for all floating-point types. Specializations for integer
|
| 301 |
types shall return `round_toward_zero`.
|
| 302 |
|