|
Author |
Topic: ln/log (Read 424 times) |
|
JohnG
|
ln/log
« on: Oct 1st, 2003, 6:05am » |
|
Is there any logarithm function in proce55ing at all? I've not been able to find one in the reference, or find that there happens to be an unlisted one, and I was wondering if one is going to be included? Or failing that, anyone have a fairly efficient log method? I'm currently more interested in it just being fairly accurate, but pretty quick, as it needs to run for each pixel on screen.
|
|
|
|
fry
|
Re: ln/log
« Reply #1 on: Oct 1st, 2003, 7:02am » |
|
you can use java's Math.log(): float theLog = float(Math.log(someNumber));
|
|
|
|
JohnG
|
Re: ln/log
« Reply #2 on: Oct 2nd, 2003, 11:10am » |
|
on Oct 1st, 2003, 7:02am, fry wrote:you can use java's Math.log(): float theLog = float(Math.log(someNumber)); |
| That's just what I was looking for, thanks.
|
|
|
|
Euskadi
|
Re: ln/log
« Reply #3 on: Dec 10th, 2003, 3:17am » |
|
how about e? it would be nice to have constant e()
|
|
|
|
benelek
|
Re: ln/log
« Reply #4 on: Dec 10th, 2003, 7:25am » |
|
float e = (float)Math.E;
|
|
|
|
Euskadi
|
Re: ln/log
« Reply #5 on: Dec 10th, 2003, 10:59pm » |
|
Thanks! I feel silly for not looking there first given the discussion above. I'm going to have to put a sticky on my monitor reminding that when all else fails check Java.
|
|
|
|
|