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
Currently, FixedPointNumbers does not support bitwise operations other than ~.
Perhaps & and | should be manipulated in the raw type using reinterpret, so that there is no ambiguity.
The same can be said for the bit shift operators. One of the ambiguity issues is about whether the decimal point should be shifted. In practice, however, this will not be so ambiguous. In my intuition, the decimal point will not shift, i.e., it is expected to keep the original type.
Another issue is that the multiplication and division for Integer and FixedPoint numbers are promoted to floating-point numbers (in FixedPointNumbers v0.9 series).
julia>0.5Q0f7 /2# master i.e. the next v0.9 series0.25f0
Often << 1 is associated with "twice", >> 1 with "half". However, confusing them with integer multiplication and division can easily lead to type instability problems.
I would like to use
<<
and>>
to shift bits of fixed point numbers.For example, suppose
x
is a fixed point, then I wantx >> 1
to be something like
reinterpret(typeof(x), reinterpret(Int, x) >> 1)
The text was updated successfully, but these errors were encountered: