First minor release
Technically some of the earlier patch releases should have been minor releases, but I wasn't expecting this library to get as popular as it has done. I'm now aiming to stick to semver as much as possible.
This release contains several new features and one bugfix.
Features include:
- Operators for converting between
SFixedandUFixedtypes.- This change was long overdue, but I am satisfied that the chosen implementation is better than what I might have come up with a few years ago.
- Integer conversion operators
- Ooperators for converting to all of the built-in integer types (
char,short,int,long,long longand allsignedandunsignedvariations thereupon). - These are all explicit operators because conversion from fixed point to integer is an inherantly narrowing operation.
- Ooperators for converting to all of the built-in integer types (
- Postincrement and postdecrement operators.
- They are provided for completeness, though I would advise against using them.
- Bitwise shift operators.
- These have been added purely to facilitate cheaper and faster multiplication and division by powers of two. Personally I'm not a fan of using bitshift operators for this purpose because I believe it harms readability, but since it's unlikely that a compiler would be able to perform such an optimisation on a user-defined type and I expect most users of this library are targetting microcontrollers, I've decided that the potential memory savings are worth the harmed readability.
Bugfixes include:
++and--would cause a shift overflow for larger types because a lone1was being treated asintinstead of a suitably large type. This was more of a problem for AVR CPUs, whereintis only 16 bits wide.