Fixed Point
This library has been modified from cubit library by influenceth and adjusted to match with other fixed point implementations.
This API provides basic some operations for signed fixed point numbers. Fixed point numbers are represented as a struct with a magnitude and a sign.
The magnitude represents the absolute value of the number, and the sign indicates whether the number is positive or negative.
Data types
Orion supports currently these fixed point types:
Fixed
Trait
Fixed
TraitFixed
trait defines the operations that can be performed on a fixed point.
Arithmetic & Comparison operators
FixedType
implements arithmetic and comparison traits. This allows you to perform basic arithmetic operations using the associated operators. (+
,+=
-
,-=
*
,*=
/
, /=
), as well as relational operators (>
, >=
,<
, <=
, ==
, !=
).
Examples
Last updated