Hi all,

I was wondering how BASIC calculates LOG(x). Does it use a look-up table
(would require massive amounts of memory), some sort of algorithm (would
require massive amounts of CPU time), or some mixed method?

I'm trying to speed up multiplication and division (in machinecode) by
using the following:
log(x) + log(y) = log(x*y)
log(x) - log(y) = log(x/y)

I calculated I'd need about 96kB for a look-up table with reasonable
accuracy. Because log(256*256)=4.8164 I'd need 48164 x 2 bytes.

Although I don't mind wasting that much memory, there has to be a smarter
way...

Greetz,
        Patriek


****
MSX Mailinglist. To unsubscribe, send an email to [EMAIL PROTECTED] and put
in the body (not subject) "unsubscribe msx [EMAIL PROTECTED]" (without the
quotes :-) Problems? contact [EMAIL PROTECTED] (www.stack.nl/~wiebe/mailinglist/)
****

Reply via email to