FixedPointsArduino icon indicating copy to clipboard operation
FixedPointsArduino copied to clipboard

Add template aliases SQ and UQ in FixedPointsCommon

Open Pharap opened this issue 4 years ago • 0 comments

Add template aliases SQ<I, F> and UQ<I, F> to FixedPointsCommon.h.

These would effectively serve as a more convinient short-hand for those who are familiar with Q notation and would probably be direct aliases for SFixed and UFixed.

I.e.

template< unsigned Integer, unsigned Fraction >
using SQ = SFixed<Integer, Fraction>;

template< unsigned Integer, unsigned Fraction >
using UQ = UFixed<Integer, Fraction>;

If this change is made after the resolution of #19 then it may be worth having a more complex implementation that also permits a single template parameter when no integer part is desired.

Pharap avatar Mar 26 '21 19:03 Pharap