calculator icon indicating copy to clipboard operation
calculator copied to clipboard

Entering negative exponents in Scientific mode is not supported

Open SaprativRay opened this issue 5 years ago • 16 comments

Describe the bug The Calculator app does not support entering negative exponents. For example, in the Scientific mode, we can enter "2.6e2" produces the expected output 260 but trying to type "2.6e-2" does not give 0.026 as it should. I even tried to put the -2 within parentheses to make sure it understands that the dash symbol is not for subtraction here but even that fails.

Steps To Reproduce

  1. Open the Calculator app in Scientific mode.
  2. Type "2.6e-2" and attempt to calculate it.
  3. The answer reported back is 0.6 instead of the expected 0.026.

Expected behavior The Calculator app should ideally support entering negative exponents and on typing "2.6e-2" in Scientific mode, it should understand that a dash following an exponent symbol 'e' is not supposed to mean subtraction but a negation.

Screenshots image

Device and Application Information

  • OS: Windows 10 Home Insider Preview Single Language
  • OS Build: 10 - 0 -20161 - 0 (20161.rs_prerelease.200627-1754)
  • Architecture: x64
  • Application Version: 10.2005.23.0

Requested Assignment I'm just reporting this problem. I don't want to fix it.

SaprativRay avatar Jul 12 '20 05:07 SaprativRay

I agree. I feel that typing a '-' after 'e' should make the exponent negative.

shobhit-kumar-code avatar Jul 12 '20 07:07 shobhit-kumar-code

This is your friendly Microsoft Issue Bot. I've seen this issue come in and have gone to tell a human about it.

MicrosoftIssueBot avatar Jul 13 '20 09:07 MicrosoftIssueBot

Thanks for the bug report! If you use the in-app keyboard, it works as expected, but I agree that when typing it out, we should be smarter at handling negation vs. subtraction in this case.

grochocki avatar Jul 14 '20 19:07 grochocki

Thanks for the bug report! If you use the in-app keyboard, it works as expected, but I agree that when typing it out, we should be smarter at handling negation vs. subtraction in this case.

Not for me it doesn't. Using the in-app keyboard for the above example results in 0.6, just as above.

Calculator 10.2005.23.0 Windows 10 PRO 10.0.18362 Build 18362

paynterf avatar Jul 28 '20 19:07 paynterf

Hmm, this is what I see (for me, it works regardless to whether you hit +/-2 or 2+/-):

sec905t08T

grochocki avatar Aug 03 '20 04:08 grochocki

Ah, the mysterious '+/-' key! That did the trick, but I gotta ask, why doesn't

2.6 [exp] - (the regular minus key) 2

work? After all, that is the normal entry sequence.....

Frank

paynterf avatar Aug 03 '20 14:08 paynterf

I suspect what is happening here is that we are strictly parsing - (and the minus key on a physical keyboard) as subtract. In many cases -2 will effectively give you -2. Even when entering something like 5+-2, we show 3, but adding a negative is the same as subtraction. In some cases, like here when trying to input a number in scientific notation, processing as subtraction causes the issue.

grochocki avatar Aug 04 '20 07:08 grochocki

Yes, I agree that's what is happening, but I hope you agree that for a calculator app to insist on parsing the '-' sign as 'subtraction' immediately after the user presses the 'exp' key isn't very helpful. I don't know who was programming this, but they obviously don't know much about math notation ;-).

Frank

paynterf avatar Aug 04 '20 15:08 paynterf

I hope you agree that for a calculator app to insist on parsing the '-' sign as 'subtraction' immediately after the user presses the 'exp' key isn't very helpful.

I agree! I think we can certainly be smarter about handling the '-' contextually based on what else you are inputting.

grochocki avatar Aug 04 '20 17:08 grochocki

the requirement to use the [EXP] button is annoying. I just want to type 2.6*10^-2 on the keyboard and be done with it.

image

MovGP0 avatar Aug 07 '20 12:08 MovGP0

I certainly agree with that sentiment. Having a 'scientific' calculator that doesn't know exponential notation that has been in common use for decades is a bit of a joke, IMHO

paynterf avatar Aug 07 '20 14:08 paynterf

Try pressing 'e' will get you X*10^Y as well. Apparently only F9 gets the '+/-' quick key function (from the Windows site: https://support.microsoft.com/en-us/windows/keyboard-shortcuts-in-apps-139014e7-177b-d1f3-eb2e-7298b2599a34#bkmk_cal)

elmorr avatar Nov 13 '20 19:11 elmorr

Does anyone know of a better caculator for maths on Windows other than the bundled one?

Caculating negative exponents of Eulers constant is not very intuitive at all.

Michael-McD avatar Aug 04 '21 15:08 Michael-McD

i have solved this issue if you want negative exponent type 2^(-5) this will solve your issue Thanks me later

localehost avatar Jun 10 '23 02:06 localehost

looks like the sequence you enter values is the issue. If you enter for example, 2^5 then hit the (+/-) key in the calculator app, it gives you the correct result. However, if you try 2^(-5), it would result in 32. If you want to test it out, follow the order below and it should work as expected.

1st - Click Red 2nd - Click Yellow 3rd - Click Green 4th - Click Blue 5th - Click Purple

Calculator

Azazuplayz avatar Nov 14 '23 17:11 Azazuplayz

Thanks to the hints above, I've tried to click it all the way with the mouse to get a precise representation of 1,39 * 10^(-6) as a decimal for a test ride:

  • clicking numbers 1, ,, 3, 9 => got 1,39 displayed
  • clicked exp => got 1,39e+0 displayed
  • clicked +/- => got 1,39e-0 displayed
  • clicked 6 => got 1,39e-6 displayed
  • clicked = => got 0,00000139 displayed

So far so good.

Copying it out of the calculator into this post proved to be a hassle - Ctrl+C was apparently ignored; right-clicking on the numeric display offered a context menu to "Select All" first, then it could "Copy". The selection is not highlighted (background remains white) which is not too helpful but oh well :) UPDATE: It did highlight for Ctrl+A, and later for another mouse context menu attempt. Maybe it matters which part of the display area I clicked into.

Following another suggestion for F9 = +/- also worked for a completely-keyboard typing session:

  • typed numbers 1, ,, 3, 9 => got 1,39 displayed
  • typed e => got 1,39e+0 displayed
  • pressed F9 => got 1,39e-0 displayed
  • typed 6 => got 1,39e-6 displayed
  • pressed ENTER => got 0,00000139 displayed

Finally, pasting 1,39 * 10^(-6) also worked (but required the parentheses around -6).

jimklimov avatar Mar 25 '24 11:03 jimklimov