Log Functions

Andrew Cowan

Senior Member
I've done this using a lookup table - is this any use? However, this would either take a lot of memory, or just be for a few values of x.

A
 
Last edited:

westaust55

Moderator
For the trig functions such as sin and cos, even Rev Ed only use a look-up table as opposed to taking up a lot of memory space with computational methods.

You could always set up a table in PICAXE EEPROM or even in an external i2c EEPROM.
 

VE3KL

New Member
Does any body know how to calculate log(x) to any base using the Picaxe 28X1?
Thanks
Thanks everyone for their responses.
I am looking for the type of math that is used in the basic stamp. I think it can be done using some of the picaxe functions without using look up tables or external chips. If I figure this out,I will gladly share it with others.
Dave
 

westaust55

Moderator
Not sure exactly what more you are expecting.

The B.Stamp2 has SIN, COS and ATN functions

PICAXE X1 parts have SIN and COS. X2 parts add ATN function.

Albeit that I have never used Stamps, I did download the manuals for same years ago - seems V2.2 is still the most current.
For the B.Stamp chips, Tracy Allen is one of the guru's on such things as Stamp maths and the author of the information on Logarithm computations in the link that eclectic provided a few posts back. That maths covers logs by table and calculation

Stamp and PICAXE programming is "fairly" similar so you can convert from Tracy Allens article to the PICAXE.



Edit:
Some added thoughts:
Go to: http://rechneronline.de/logarithm/
Right click and select View Page Source
and then study the html code to see how they are calculating logs to any base

Edit2: Quick look myself and they are using "a" to the power of "b"
 
Last edited:

Jeremy Leach

Senior Member
Hi ...I'd like to know 'why' you want to calculate log(x) to any base :rolleyes:. Just out of interest, and maybe there is another way round your problem...
 
Top