Select to view content in your preferred language

# ArcGIS Pro 3.0.2: How to calculate the Ln(x) with Arcade?

1291
4
07-04-2023 02:46 AM
Legendary Contributor

ArcGIS Pro 3.0.2: How to calculate the Ln(x) with Arcade?

I observed that the Ln(x) is not available in the list of “Helpers”.

But mathematically, Ln(x) = 2.403 Log(x)

What is shocking is that the Log (x) in Arcade calculates the Ln(x) but not Log(x)

What could be the issue here?

----------------------------------------
Jamal Numan
Geomolg Geoportal for Spatial Information
Ramallah, West Bank, Palestine
1 Solution

Accepted Solutions
Esri Contributor

I would recommend using the Python code for this, it looks like something is missing in the Arcade section and I would suggest raising this with your distributor to have it raised as an enhancement for future releases or raise this within the Esri Ideas page.

I have noticed that if you use Python and this function it should get you the desired outcome

Using math.log10() gives you a logarithmic value as seen below

If you use math.log() this will perform the inverse log giving you the natural log (Ln)

I hope this has helped.

The Log() expression in Arcade is described to return the following

"Returns the natural logarithm (base E) of a."

4 Replies
Esri Contributor

I would recommend using the Python code for this, it looks like something is missing in the Arcade section and I would suggest raising this with your distributor to have it raised as an enhancement for future releases or raise this within the Esri Ideas page.

I have noticed that if you use Python and this function it should get you the desired outcome

Using math.log10() gives you a logarithmic value as seen below

If you use math.log() this will perform the inverse log giving you the natural log (Ln)

I hope this has helped.

The Log() expression in Arcade is described to return the following

"Returns the natural logarithm (base E) of a."

MVP Frequent Contributor

This is a difference in conventions between programming and mathematics and is completely expected behavior. In many (if not most) programming languages, log(x) calculates the natural logarithm (base e).

This is also described in the respective documentations. For example:

etc...

Have a great day!
Johannes
MVP Esteemed Contributor

or convert from one base to another

ln(x) = log10(x) / log10(e)

... sort of retired...
Legendary Contributor

It works fine with the Python as per the screenshots below

----------------------------------------
Jamal Numan
Geomolg Geoportal for Spatial Information
Ramallah, West Bank, Palestine