Math.log10 is not a function??
Hey all,
I'm trying to execute Math.log10() in javascript and I get an error saying Javascript TypeError: Math.log10() is not a function. Standard Math.log() works smoothly. Any ideas what could cause this?
Thanks in advance.
Math.log10 is a legitimate function of the JavaScript math library, but I confirm that it doesn't work for me in Max (7.0.3 32-bit, MacOS 10.8.5). As you probably know, this does work:
function log10(f)
{
return Math.log(f)/Math.log(10.);
}
Thanks for the workaround Christopher, my maths is a bit rusty, this works like a charm.
For future readers, my specs are Max 7.0.0 on Windows 8.1.
Oops. I had an extra ')' in my JavaScript above. I've corrected it.
Math.log10 will be legitimate when ECMAScript 6 is released ;-)