template <typename Integer, size_t FractionalBits>
class Fixed
Defined at line 41 of file ../../zircon/system/ulib/ffl/include/ffl/fixed.h
Forward declaration.
Public Methods
Fixed<Integer, FractionalBits> FromRaw (Integer value)
Returns the given raw integer as a fixed-point value in this format.
Defined at line 48 of file ../../zircon/system/ulib/ffl/include/ffl/fixed.h
Fixed<Integer, FractionalBits> Min ()
Returns the minimum value of this fixed point format.
Defined at line 53 of file ../../zircon/system/ulib/ffl/include/ffl/fixed.h
Fixed<Integer, FractionalBits> Max ()
Returns the maximum value of this fixed point format.
Defined at line 56 of file ../../zircon/system/ulib/ffl/include/ffl/fixed.h
Fixed<Integer, FractionalBits> Epsilon ()
Returns the smallest positive value of this fixed point format.
Defined at line 59 of file ../../zircon/system/ulib/ffl/include/ffl/fixed.h
void Fixed<Integer, FractionalBits> ()
Fixed is default constructible without a default value, which is the same
as for plain integer types. This is permitted in constexpr contexts as
long as the underling integer member |value_| is initialized before use.
Defined at line 64 of file ../../zircon/system/ulib/ffl/include/ffl/fixed.h
void Fixed<Integer, FractionalBits> (const Fixed<Integer, FractionalBits> & )
Fixed is copy constructible and assignable.
Defined at line 67 of file ../../zircon/system/ulib/ffl/include/ffl/fixed.h
Fixed<Integer, FractionalBits> & operator= (const Fixed<Integer, FractionalBits> & )
Defined at line 68 of file ../../zircon/system/ulib/ffl/include/ffl/fixed.h
void Fixed<Integer, FractionalBits> (Integer value)
Explicit conversion from an integer value. The value is saturated to fit
within the integer precision defined by Format::IntegerBits.
Defined at line 72 of file ../../zircon/system/ulib/ffl/include/ffl/fixed.h
template <Operation Op, typename... Args>
void Fixed<Integer, FractionalBits> (Expression<Op, Args...> expression)
Implicit conversion from an intermediate expression. The value is converted
to the precision and resolution of this type, if necessary.
Defined at line 77 of file ../../zircon/system/ulib/ffl/include/ffl/fixed.h
template <typename OtherInteger, size_t OtherFractionalBits, typename = std::enable_if_t<!std::is_same_v<Integer, OtherInteger> ||
FractionalBits != OtherFractionalBits>>
void Fixed<Integer, FractionalBits> (const Fixed<OtherInteger, OtherFractionalBits> & other)
Explicit conversion from another fixed point type. The value is converted
to the precision and resolution of this type, if necessary.
Defined at line 85 of file ../../zircon/system/ulib/ffl/include/ffl/fixed.h
template <Operation Op, typename... Args>
Fixed<Integer, FractionalBits> & operator= (Expression<Op, Args...> expression)
Assignment from an intermediate expression. The value is rounded and
saturated to fit within the precision and resolution of this type, if
necessary.
Defined at line 92 of file ../../zircon/system/ulib/ffl/include/ffl/fixed.h
void Fixed<Integer, FractionalBits> (Value<Format> value)
Implicit conversion from an intermediate value of the same format.
Defined at line 97 of file ../../zircon/system/ulib/ffl/include/ffl/fixed.h
Fixed<Integer, FractionalBits> & operator= (Value<Format> value)
Assignment from an intermediate value of the same format.
Defined at line 100 of file ../../zircon/system/ulib/ffl/include/ffl/fixed.h
Integer raw_value ()
Returns the raw fixed-point value as the underling integer type.
Defined at line 103 of file ../../zircon/system/ulib/ffl/include/ffl/fixed.h
Value<Format> value ()
Returns the fixed-point value as an intermediate value type.
Defined at line 106 of file ../../zircon/system/ulib/ffl/include/ffl/fixed.h
Integer Ceiling ()
Returns the closest integer value greater-than or equal-to this fixed-
point value.
Defined at line 110 of file ../../zircon/system/ulib/ffl/include/ffl/fixed.h
Integer Floor ()
Returns the closest integer value less-than or equal-to this fixed-point
value.
Defined at line 121 of file ../../zircon/system/ulib/ffl/include/ffl/fixed.h
Integer Round ()
Returns the rounded value of this fixed-point value as an integer.
Defined at line 129 of file ../../zircon/system/ulib/ffl/include/ffl/fixed.h
Fixed<Integer, FractionalBits> Integral ()
Returns the integral component of this fixed-point value. The result retains
the sign of this value. For example, Fixed{-2.5}.Integral() == -2.
This preserves the following invariant:
Fixed f;
f.Integral() + f.Fraction() == f
Defined at line 144 of file ../../zircon/system/ulib/ffl/include/ffl/fixed.h
Fixed<Integer, FractionalBits> Fraction ()
Returns the fractional component of this fixed-point value. The result retains
the sign of this value. For example, Fixed(-2.5).Fraction() == -0.5.
See Integral().
Defined at line 161 of file ../../zircon/system/ulib/ffl/include/ffl/fixed.h
Fixed<Integer, FractionalBits> Absolute ()
Returns the absolute value of this fixed-point value.
Defined at line 164 of file ../../zircon/system/ulib/ffl/include/ffl/fixed.h
bool operator< (Fixed<Integer, FractionalBits> other)
Relational operators for same-typed values.
Defined at line 182 of file ../../zircon/system/ulib/ffl/include/ffl/fixed.h
bool operator> (Fixed<Integer, FractionalBits> other)
Defined at line 183 of file ../../zircon/system/ulib/ffl/include/ffl/fixed.h
bool operator<= (Fixed<Integer, FractionalBits> other)
Defined at line 184 of file ../../zircon/system/ulib/ffl/include/ffl/fixed.h
bool operator>= (Fixed<Integer, FractionalBits> other)
Defined at line 185 of file ../../zircon/system/ulib/ffl/include/ffl/fixed.h
bool operator== (Fixed<Integer, FractionalBits> other)
Defined at line 186 of file ../../zircon/system/ulib/ffl/include/ffl/fixed.h
bool operator!= (Fixed<Integer, FractionalBits> other)
Defined at line 187 of file ../../zircon/system/ulib/ffl/include/ffl/fixed.h
template <typename T, typename Enabled = EnableIfUnaryExpression<T>>
Fixed<Integer, FractionalBits> & operator+= (T expression)
Compound assignment operators.
Defined at line 191 of file ../../zircon/system/ulib/ffl/include/ffl/fixed.h
template <typename T, typename Enabled = EnableIfUnaryExpression<T>>
Fixed<Integer, FractionalBits> & operator-= (T expression)
Defined at line 196 of file ../../zircon/system/ulib/ffl/include/ffl/fixed.h
template <typename T, typename Enabled = EnableIfUnaryExpression<T>>
Fixed<Integer, FractionalBits> & operator*= (T expression)
Defined at line 201 of file ../../zircon/system/ulib/ffl/include/ffl/fixed.h
template <typename T, typename Enabled = EnableIfUnaryExpression<T>>
Fixed<Integer, FractionalBits> & operator/= (T expression)
Defined at line 206 of file ../../zircon/system/ulib/ffl/include/ffl/fixed.h