loyd / fixnum

Fixed-point numbers
MIT License
7 stars 6 forks source link

Support for unsigned `Fixed`-point operations #33

Open appetrosyan opened 2 years ago

appetrosyan commented 2 years ago

Sometimes it is obvious that a number cannot be negative (or zero). It is also true of fixed point numbers.

Given this, it would be nice if Fixed supported using the extra bit for the precision, e.g.

The implementations for cadd, csub etc. need to be adjusted accordingly.

loyd commented 2 years ago

I've thought about it, and it would be a nice feature, but I'm afraid to complicate things while all FixedPoint instances are generated by a macro. I want to reconsider this idea after moving to const generics.