You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constexpr operator long double() const noexcept; // There are no long doubles on device
157
164
};
158
165
159
166
} // namespace int128
160
167
} // namespace boost
161
168
----
162
169
170
+
All conversion operators except `operator bool()` are implicit to match the behavior of built-in integer types.
171
+
`operator bool()` is explicit so that an `int128_t` cannot accidentally bind to a `bool` parameter; contextual conversions (`if (x)`, `!x`, etc.) still work.
163
172
Conversions to unsigned integers are subject to mixed sign limitations discussed xref:int128_t.adoc#i128_operator_behavior[above].
164
-
Conversion to `bool` is not marked explicit to match the behavior of built-in integer types.
165
-
Conversions to floating point types may not be lossless depending on the value of the `int128_t` at time of conversion,
173
+
Conversions to floating-point types may not be lossless depending on the value of the `int128_t` at time of conversion,
166
174
as the number of digits it represents can exceed the precision of the significand in floating point types.
constexpr operator long double() const noexcept; // There are no long doubles on device
158
165
};
159
166
160
167
} // namespace int128
161
168
} // namespace boost
162
169
----
163
170
171
+
All conversion operators except `operator bool()` are implicit to match the behavior of built-in integer types.
172
+
`operator bool()` is explicit so that a `uint128_t` cannot accidentally bind to a `bool` parameter; contextual conversions (`if (x)`, `!x`, etc.) still work.
164
173
Conversions to signed integers are subject to mixed sign limitations discussed xref:uint128_t.adoc#u128_operator_behavior[above].
165
-
Conversion to `bool` is not marked explicit to match the behavior of built-in integer types.
166
-
Conversions to floating point types may not be lossless depending on the value of the `uint128_t` at time of conversion,
174
+
Conversions to floating-point types may not be lossless depending on the value of the `uint128_t` at time of conversion,
167
175
as the number of digits it represents can exceed the precision of the significand in floating point types.
0 commit comments