Following on from the discussion in the CPC maths thread, I've continued working on fixed point support.
There's been some major changes to bring the implementation more into line with N1169:
- The main header is now <math/math_fix16.h>, and the former fix88_t typedef is now known "Accum" which can be used on both compilers.
- sccz80 now supports a 16 bit _Accum datatype from N1169. This means that fixed point values are constructed automatically by the compiler and conversion to and from other types happens transparently. This behaves in the same way as the Float16 datatype added a couple of years ago
- The mathematical function names now have the suffix k rather than fix88. For example sink, expk etc
There's partial support for unsigned _Accum, and placeholders for long _Accum and unsigned long _Accum - but there's no library support for 32bit fixed point numbers.
Fixed point maths
Re: Fixed point maths
Thank you, seriously.