Copy link to clipboard
Copied
Hi,
Unless I'm mistaken, I just realized that the Math.acosh() Javascript method doesn't work with Acrobat. So I recreated it with a function:
function acosh(x) {
return Math.log(x+Math.sqrt(Math.pow(x,2)-1));
}
Has anyone heard of this and know why? Are there other Math methods that don't work?
Thanks
@+
Copy link to clipboard
Copied
Math.trunc() doesn't work.
Copy link to clipboard
Copied
Hi,
Instead of, you can use this function:
function trunc(x) {
return Number(x.toString().substr(0,x.toString().indexOf(".")));
};
@+
Copy link to clipboard
Copied
This is a verision thing. Acrobat does not incorporate the latest version of core JavaScript. So there are a number of JS features that do not work.
Copy link to clipboard
Copied
Apparently all hyperbolic functions don't work!
If you're interested, here are the associated functions:
//********
// cosh **
//********
function cosh(x) {
return (Math.exp(x)+Math.exp(-x))/2;
};
//*********
// acosh **
//*********
function acosh(x) {
return Math.log(x+Math.sqrt(Math.pow(x,2)-1));
}
//********
// sinh **
//********
function sinh(x) {
return (Math.exp(x)-Math.exp(-x))/2;
};
//*********
// asinh **
//*********
function asinh(x) {
if (x===-Infinity) return x;
else return Math.log(x+Math.sqrt(Math.pow(x,2)+1));
}
//********
// tanh **
//********
function tanh(x) {
var a=Math.exp(+x);
var b=Math.exp(-x);
return a==Infinity?1:b==Infinity?-1:(a-b)/(a+b);
};
//*********
// atanh **
//*********
function atanh(x) {
return Math.log((1+x)/(1-x))/2;
};
@+
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more