With features like Dark Mode, Stacks, and four new built-in apps, macOS Mojave helps you get more out of every click.  Find out how to upgrade to macOS Mojave > https://support.apple.com/macos/mojave

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Question:

# Question:Q:calculator cannot take a natural log of a negative number --states Not a Number

When I input a -1 and take the ln function for natural logarithm, it returns "Not a Number". I upgraded to 10.13.1 and now the calculator doesn't seem to work correctly.

Mac mini, macOS High Sierra (10.13.1)

Posted on

The natural logarithm function ln(x) is defined only for x>0.

So the natural logarithm of a negative number is undefined.

ln(x) is undefined for x ≤ 0

Nov 15, 2017 6:54 PM

When I input a -1 and take the ln function for natural logarithm, it returns "Not a Number".

What did you expect?

Nov 15, 2017 6:56 PM

Nov 15, 2017 8:36 PM in response to MarkFly In response to MarkFly

Folks, I misstated the issue as I tried using the ln function to reverse e^x. The real problem is that when I input a -1 and apply the e^x function, it returns "Not a number". This function is defined for x in (-infty, +infty) and so should produce a real value. I played around with the inverse function ln and it seems to work for real valued results of e^x once that works, but e^x seems to work only for positive values. To compute the values I want I have to go thru the rigamarole of calculating e^x for positive values and then inverting it to 1/e^x. That comes out just fine, but what a pain! Try putting -1 into e^x and see what happens!

Nov 15, 2017 8:36 PM

Nov 15, 2017 9:09 PM in response to dialabrain In response to dialabrain

and, FWIW, Spotlight and Siri get it.

Nov 15, 2017 9:09 PM

MarkFly wrote:

To compute the values I want I have to go thru the rigamarole of calculating e^x for positive values and then inverting it to 1/e^x. That comes out just fine, but what a pain! Try putting -1 into e^x and see what happens!

Not sure why it's "a pain". It requires the same number of clicks whether you enter a negative or positive value. Three.

Nov 16, 2017 5:24 AM

I'm seeing the same issue... upon entering "1" and "+/-" to invert the sign, pressing e^x gives the result "0" (incorrect).

Doing the same sequence of operations but pressing 10^x yields 0.1, the correct result.

There appears to be an issue with the calculator app.

Nov 16, 2017 6:17 AM

Nov 16, 2017 6:19 AM in response to William Tomcanin In response to William Tomcanin

...if fact e^x for any negative "x" yields "0" -- definitely a problem with the calculator app!

Nov 16, 2017 6:19 AM

William Tomcanin wrote:

I'm seeing the same issue... upon entering "1" and "+/-" to invert the sign, pressing e^x gives the result "0" (incorrect).

Doing the same sequence of operations but pressing 10^x yields 0.1, the correct result.

There appears to be an issue with the calculator app.

Yes, there is something wrong with the Calculator but .1 is incorrect.

Try this in order.

(fixed)

Nov 16, 2017 6:36 AM

Nov 16, 2017 6:38 AM in response to dialabrain In response to dialabrain

Well that didn't render correctly. Press the keys in order from right to left.

(fixed)

Nov 16, 2017 6:38 AM

0.1 IS the correct result for 10^-1... I think you misunderstood my post.

I've tested this on my other macintosh running Mac OS 10.5.8, and the calculator produces the correct result for e^-1

Interesting that the Calculator app (of all things) would have a problem.

Nov 16, 2017 6:37 AM

As I mentioned, yes, there is a problem with the calculator. The value of 10^-1 has nothing to do with the OP.

Nov 16, 2017 6:41 AM

Yes, I had indicated that that sequence works in my 2nd message. The app is messed up for sure. Be nice if someone could fix it!

Nov 16, 2017 8:07 AM

I totally agree. Very annoying. Do you know if Apple is working to fix it?

Nov 16, 2017 8:08 AM

MarkFly wrote:

Yes, I had indicated that that sequence works in my 2nd message. The app is messed up for sure. Be nice if someone could fix it!

Yes I know. I was confused by "rigamarole" and "a pain". 😎

You can send Apple feedback…

Feedback - macOS - Apple

Nov 16, 2017 8:12 AM

User profile for user: MarkFly

Question: calculator cannot take a natural log of a negative number --states Not a Number