3 ms·
I'd love to see some implementations of fixed point trig functions, but I haven't found any! Do you have any links by any chance?
by rtfeldman 4y ago
I'd love to see some implementations of fixed point trig functions, but I haven't found any! Do you have any links by any chance?
- Someone 4y agoI’d Google “forth trig functions” and get, for example https://web.stanford.edu/~dljaffe/SVFIG99/trig.html https://web.stanford.edu/~dljaffe/SVFIG99/trig.html https://www.hpmuseum.org/forum/thread-18123.html https://www.hpmuseum.org/forum/thread-18123.html (which links to https://archive.org/details/Forth_Dimension_Volume_04_Number_1/page/n8/mode/1up https://archive.org/details/Forth_Dimension_Volume_04_Number...)
- rtfeldman 4y agoNice, I didn't realize Forth used them - thank you!
- ChuckNorris89 4y agoI don't have the code at hand to show you, nor do I have any links similar trig stuff as I wrote everything from scratch, first in Matlab to prover the concept, then in C, as there wasn't anything similar online at the time, but I used the principles of fixed point fractional math of representing floating point numbers as scaled integers in the Q notation, which is well documented for use in microcontrollers and DSPs of the era (early to late '00s) Here's the wiki gist with some C code snippet examples [1]. Here's a more detailed math paper that goes in the weeds[2]. Here's a nice presentation from Motorola-Freescale-NXP I just found which I wish I had back then as this is awesome and explains the basics for everyone to understand, and seeing those Motorola Windows 95 GUI tools brings a nostalgic smile on my face. [1] https://en.wikipedia.org/wiki/Q_(number_format) https://en.wikipedia.org/wiki/Q_(number_format) [2] http://darcy.rsgc.on.ca/ACES/ICE4M/FixedPoint/FixedPointRepresentationFractionalMath.pdf http://darcy.rsgc.on.ca/ACES/ICE4M/FixedPoint/FixedPointRepr... [3] https://www.nxp.com/files-static/training_presentation/TP_CONTROLLER_CONTINUUM_FP.pdf https://www.nxp.com/files-static/training_presentation/TP_CO...