avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] Re: AVR-GCC-list Digest, Vol 50, Issue 10


From: David VanHorn
Subject: [avr-gcc-list] Re: AVR-GCC-list Digest, Vol 50, Issue 10
Date: Wed, 4 Mar 2009 15:44:53 -0500


The C preprocessor is too basic to do this sort of thing. Functions like
logarithms come from the math library the the preprocessor can't make
use of libraries at compile time.

This is a PERL script I use to generate sine tables to load onto a
Mega48. It shouldn't be hard to adapt it to generate a log table too:
 
Ok, I'll have to see what it takes to do this in windows.
 
Keep in mind there are algorithmic ways too do logs even without
floating point support, they're going to be more compact than a table,
but slower. If speed is your #1 concern then a table is best. Don't
forget to use the appropriate function to read the data out of flash,
you can't just index the array (unfortunately).
 
I'm very pressed for time in this operation.
I may need 512 entries in my log table, but I need SPEED.
I have several oodles of codespace.

 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]