FixedPointsArduino
FixedPointsArduino copied to clipboard
A fixed point arithmetic library for Arduino
Hi You have explicitly declared that this library is only compatible with the Arduino platform. But isn't this extremely cross-platform-compatible? I propose you remove the platform limitations unless there is...
**Brief Description** Casting between different signed types can have unintuitive (incorrect?) results. Some examples of how to do this correctly would be welcomed. **Observed Behaviour** When casting negative Q1.14 values...
Aparently cases of `>> 8`, `>> 16` and `>>32` aren't being optimised to simply drop the bytes as I was originally expecting. This isn't much of an issue for more...
At present there's a strong possibility that the compiler does not optimise fixed points defined with a zero-width fraction part due to the extra operations required for fractional fixed points....
Add template aliases `SQ` and `UQ` to `FixedPointsCommon.h`. These would effectively serve as a more convinient short-hand for those who are familiar with [Q notation](https://en.wikipedia.org/wiki/Q_(number_format)) and would probably be direct...
There are times where it may be useful to be able to represent fixed points using notation other than the conventional [Q format](https://en.wikipedia.org/wiki/Q_(number_format)). For example, it may be useful to...
I'm getting a little fed up with having to put `static_cast` everywhere when debugging so I'd like to find a means to print fixed points. Implementing printing in fractional form...
At the moment the named constants (such as `E`, `Pi`, `Tau` and `Phi`) are `static` class members of `SFixed` and `UFixed`. From a maintenance point of view, it would be...
Following the current style of not defining functions inside the main body of the class, this would mean that there would be fewer member functions kept inside the class. This...
This change would have two potential benefits: * The undefined behaviour eminating from `