Log/Antilog Table In C/C++
DavidZemon
Posts: 2,973
I'm reading through the Propeller manual and trying to understand the log & antilog tables, but I'm just not getting it. Has anyone done this in C/C++? The Spin syntax is definitely throwing me off a bit - it's just been too long since I've used Spin.
I'd like to add methods for the log and antilog to my PropWare::Utility class.
I'd like to add methods for the log and antilog to my PropWare::Utility class.
Comments
Adding this line "unsigned int x = log2(8);" used an extra ~500 bytes. That's no fun .
My current use case is replacing the following snippet of code:
Surely I can save a few bytes of code by switching to the built-in log table, all the while providing extra functionality to PropWare users.
I'm with you on the switch case being faster/smaller.
Just to clarify: are you confirming that the tables in ROM use floating point (as in, IEEE 754) numbers? And, if that is the case, the math functions in libm.a probably use those table already, right? And that would be why no one has written their own code to do this in C/C++ - because it would be exactly the same code in PropGCC?
you rock Thank you!
David