Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Exit

- Home
- Acrobat SDK
- Discussions
- How to calculate a log base 10 equation

- How to calculate a log base 10 equation

0

/t5/acrobat-sdk-discussions/how-to-calculate-a-log-base-10-equation/td-p/10945615
Feb 25, 2020
Feb 25, 2020

Copy link to clipboard

Copied

Math.log( ) just givesme the natural log. I've tried Math.log(10, ( ) ), Math.log10( ), console.log(getBaseLog(10, ( ) ), console.log(Math.log10( )). Now I'm at a loss on how to go about solving this.

TOPICS

Acrobat SDK and JavaScript

Community guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

Community Expert
,
Feb 25, 2020
Feb 25, 2020

However, you can easily write a function that returns the log10 value using the log method, like this:

function log10(val) {

return Math.log(val) / Math.LN10;

}

And then you can call it like this, for example:

log10(2)

10
Replies
10

/t5/acrobat-sdk-discussions/how-to-calculate-a-log-base-10-equation/m-p/10945626#M7522
Feb 25, 2020
Feb 25, 2020

Copy link to clipboard

Copied

What is console.log?

Community guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

christopherj66219798
AUTHOR

New Here
,

/t5/acrobat-sdk-discussions/how-to-calculate-a-log-base-10-equation/m-p/10945805#M7523
Feb 25, 2020
Feb 25, 2020

Copy link to clipboard

Copied

Community guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

/t5/acrobat-sdk-discussions/how-to-calculate-a-log-base-10-equation/m-p/10945865#M7525
Feb 25, 2020
Feb 25, 2020

Copy link to clipboard

Copied

In Acrobat use:

console.show();

console.println( ... );

Community guidelines

/t5/acrobat-sdk-discussions/how-to-calculate-a-log-base-10-equation/m-p/10945837#M7524
Feb 25, 2020
Feb 25, 2020

Copy link to clipboard

Copied

https://sciencing.com/convert-ln-log-10-8359505.html

Also, read the Acrobat JavaScript API, you need to know the methods specific to Acrobat.

Community guidelines

/t5/acrobat-sdk-discussions/how-to-calculate-a-log-base-10-equation/m-p/10945870#M7526
Feb 25, 2020
Feb 25, 2020

Copy link to clipboard

Copied

Community guidelines

/t5/acrobat-sdk-discussions/how-to-calculate-a-log-base-10-equation/m-p/10945876#M7527
Feb 25, 2020
Feb 25, 2020

Copy link to clipboard

Copied

However, you can easily write a function that returns the log10 value using the log method, like this:

function log10(val) {

return Math.log(val) / Math.LN10;

}

And then you can call it like this, for example:

log10(2)

Community guidelines

christopherj66219798
AUTHOR

New Here
,

/t5/acrobat-sdk-discussions/how-to-calculate-a-log-base-10-equation/m-p/10945999#M7528
Feb 25, 2020
Feb 25, 2020

Copy link to clipboard

Copied

Thank you. Was stuck on how to write it out for Acrobat for a while.

Community guidelines

/t5/acrobat-sdk-discussions/how-to-calculate-a-log-base-10-equation/m-p/10946012#M7529
Feb 25, 2020
Feb 25, 2020

Copy link to clipboard

Copied

There's nothing Acrobat-specific in the code above. It's generic JS code.

Community guidelines

christopherj66219798
AUTHOR

New Here
,

/t5/acrobat-sdk-discussions/how-to-calculate-a-log-base-10-equation/m-p/10946025#M7530
Feb 25, 2020
Feb 25, 2020

Copy link to clipboard

Copied

Oh maybe I was just thinking of the wrong thing. I was trying:

function getBaseLog(x,y) {

return Math.log(y) / Math.log(x);

}

console.log(getBaseLog(2,8));

Community guidelines

Community Expert
,

LATEST
/t5/acrobat-sdk-discussions/how-to-calculate-a-log-base-10-equation/m-p/10946058#M7531
Feb 25, 2020
Feb 25, 2020

Copy link to clipboard

Copied

Community guidelines

Copyright Â© 2023 Adobe. All rights reserved.