Fixed point maths

New features and project activity between releases
Post Reply
User avatar
Well known member
Posts: 2010
Joined: Sun Jul 15, 2007 10:01 pm

Fixed point maths

Post by dom »

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.
Well known member
Posts: 171
Joined: Sun Sep 09, 2018 5:44 pm

Re: Fixed point maths

Post by tschak909 »

Thank you, seriously.
Post Reply