Constructor for Fxp class from a 16-bit signed integer.
- Parameters
-
value | The integer value to convert to fixed-point. |
This is the primary runtime constructor for integer values. For runtime conversion from other numeric types, use Convert():
static constexpr Fxp Convert(const T &value)
Convert integral type to fixed-point with compile-time range validation.
Definition fxp.hpp:156
- Note
- Converts to 16.16 fixed-point format (e.g., 10 becomes 10.0).
- Warning
- For advanced users who understand the risks of precision loss or overflow, manual casting is allowed. However, use the Convert function for safer conversions.
Fxp b = static_cast<int32_t>(someValue << 16);