trigonometry and XS-L1

Technical questions regarding the XTC tools and programming with XMOS.
ikellymo
Junior Member
Posts: 7
Joined: Tue Jun 11, 2013 4:23 am

Post by ikellymo »

Is there a trig module that I haven't found? I'm starting to work on a fast sine function, similar to some of this discussion.


User avatar
lilltroll
XCore Expert
Posts: 956
Joined: Fri Dec 11, 2009 3:53 am
Location: Sweden, Eskilstuna

Post by lilltroll »

Since Tools version 12 and later it is possible to include the "math.h" in xc files.
You do not need to write c-files when you need floating point and sin, cos etc anymore.

The computations is still translated to be run on a fixed Point CPU, so each Floating point instruction will take many CPU cycles to complete, but it is simple to use.

There is also some code on GitHub with lower precision but that is faster.