Author Topic: A warning to engineers about calculators  (Read 8569 times)

0 Members and 1 Guest are viewing this topic.

Offline Russ_ATopic starter

  • Contributor
  • Posts: 20
  • Country: ca
A warning to engineers about calculators
« on: December 14, 2024, 03:34:24 pm »
I decided to try a calculator app called Hiper Calc for Android. If you search for calculator app reviews it'll be there, highly recommended. At first I was very impressed by its ability to create user layouts. Really cool stuff. But within only a single day I uncovered several critical calculation flaws. For example, it has options for precision which are confusing. They seemed to be based on what size screen you were using. It turns out that whatever number of digits you choose to display, often 6 for readablity, is what the calculator would actually use in its calculations, which includes the ANS function (previous calculation result), stored values, etc. Crazy. So by making it a bit more readable on your phone you might only be using 4 or 5 digits in your calculations. And then I was testing its random number generator and it was completely flawed. It uses the same random number for all instances in a calculation, but then sometimes it doesn't, seemingly at random. And the last one I found was with its use of %. When typing an expression it'll put brackets around the number when you type in %, so you type 9 - 10 % and it'll have 9 - (10)% for the expression on the display. Seems great, right? What a good way to clarify what's going on. Wrong. That evaluates to 8.1. No kidding. I've been in contact with the developer and they're claiming that's the correct way of doing percentages. They just have no idea what they're doing. I explained that % should always be the same as /100 but they don't believe me. Note that this calculator allows full symbology and the entire expression to be entered at once before evaluating. This isn't some old school stepwise input. Anyway, my point is that in only a single day I've uncovered serious flaws with one of the seemingly best Android calculators out there. Please don't use a calculator that hasn't been through rigorous quality testing to do engineering calculations. I can imagine even a doctor or nurse screwing up a dosage because of the % flaw. It's crazy. So despite how cool that app is I guess I'll stick to using a handheld one that's been through the rigors of proper quality control and testing. As someone who does calculations for a living this has really put me off using apps.
 

Offline jpanhalt

  • Super Contributor
  • ***
  • Posts: 4077
  • Country: us
Re: A warning to engineers about calculators
« Reply #1 on: December 14, 2024, 03:56:51 pm »
What happens when you try (9 - 10)%  or 9% -10%? 

Frankly, I rarely calculate with percent, and it's not completely clear what answer you wanted for 9 - 10% or  9- (10)%.
 

Online Squarewave

  • Frequent Contributor
  • **
  • Posts: 386
  • Country: gb
Re: A warning to engineers about calculators
« Reply #2 on: December 14, 2024, 04:15:40 pm »
That calculators days are numbered.
 

Offline Russ_ATopic starter

  • Contributor
  • Posts: 20
  • Country: ca
Re: A warning to engineers about calculators
« Reply #3 on: December 14, 2024, 05:08:49 pm »
My problem with it is that it's an amazing calculator. It let's you make your own layouts with the functions you want. It's damn-near perfect that way, which is why it's so popular. But being able to find such critical flaws in it in only a day is ridiculous. I'm sure I can find more. And the developer doesn't know what they're doing as far as calculations are concerned. The precision flaw is simply inexcusable. The percent calculation error, and their refusal to acknowledge it is crazy too. I never realized the risks of a dodgy app until today. It could cost someone serious money or make a serious mistake that could cause real harm. I now understand why there are calculator test suites. This obviously wouldn't come anywhere close to passing. I have two Casio fx-991EX calculators, one for home and one for work. I thought I could finally just use my phone because I found an app I loved. At least I know I can trust the Casio when I type a percent sign, and I know that it's storing fifteen or so digits in memory, not 4. Thank god the only thing the app might have thrown off for me is a drafting calculation or a voltage drop. I don't design bridges or medical devices.
 

Offline golden_labels

  • Super Contributor
  • ***
  • Posts: 1504
  • Country: pl
Re: A warning to engineers about calculators
« Reply #4 on: December 14, 2024, 05:12:21 pm »
For the percent function the result is correct: 9 -10% = 9 - (9 * 10/100) = 9 - 0.9 = 8.1. I don’t recall it ever working otherwise. I also don’t see how it would work, given pocket, PoS, and office calculators do tail operations only.

However, the warning holds in general. Given you emphasized the part about reviews: beyond calculators. Don’t trust those review systems. If anything, read only negative reviews and consider them only after carefully reading and evaluating.

Even if the reviews were honest, and often they are not, the entire system can’t work. Consider, who posts those opinions. Those are completely random, anonymous people, under no obligation to express anything beyond their first emotional impression, in overwhelming majority lacking expertise to provide a reliable opinion and more often not having basic skills to conduct a test, and with the comment window too short to allow for a proper test anyway. I’ll also skip the entire topic of who runs those review systems.

If you want an opinion, there is a lot of people doing honest, proper reviews. Dave is one of them. You know, who gives the opinion. You can judge their abilities, their knowledge and experience. You know their testing methods. Even somewhat entertainment(1) YouTube channels, like Project Farm, are worth orders more than any random opinions system.


(1) I do respect the channel and that comment isn’t meant to belittle it. He does a great job. But some limitations, like being able to afford only a single specimen being tested, hamper the strength of the results. Some tests are also humorous and I believe this is intentional. Nothing wrong with that as long as one keeps that in mind. To be honest it would be detrimental to Project Farm, if tests were proper: it would then become a horrible, boring job.
People imagine AI as T1000. What we got so far is glorified T9.
 

Offline jpanhalt

  • Super Contributor
  • ***
  • Posts: 4077
  • Country: us
Re: A warning to engineers about calculators
« Reply #5 on: December 14, 2024, 05:14:53 pm »
It's still not clear what answer you expected.

Quote
When typing an expression it'll put brackets around the number when you type in %, so you type 9 - 10 % and it'll have 9 - (10)% for the expression on the display. Seems great, right? What a good way to clarify what's going on. Wrong. That evaluates to 8.1. No kidding. I've been in contact with the developer and they're claiming that's the correct way of doing percentages.

To me, 9 -10% is 8.1.  In the bolded sentence do you mean 8.1 is wrong?  Or the answer given by the calculator was not 8.1?
 

Online TimFox

  • Super Contributor
  • ***
  • Posts: 9107
  • Country: us
  • Retired, now restoring antique test equipment
Re: A warning to engineers about calculators
« Reply #6 on: December 14, 2024, 05:17:56 pm »
Can it be set up to do RPN?  That might avoid the problems reported here.
 

Offline KE5FX

  • Super Contributor
  • ***
  • Posts: 2113
  • Country: us
    • KE5FX.COM
Re: A warning to engineers about calculators
« Reply #7 on: December 14, 2024, 05:26:40 pm »
The notion that calculation precision is the same as display precision, if true, is certainly a giant red flag.

Personally I haven't touched a calculator since I found Jupyter QtConsole.  If you assign a hotkey to bring it to the foreground at any time, it's no less convenient to use than a calculator.  Great for people who like to work in consoles rather than full-fledged Jupyter notebooks.

 

Online wraper

  • Supporter
  • ****
  • Posts: 18047
  • Country: lv
Re: A warning to engineers about calculators
« Reply #8 on: December 14, 2024, 05:41:20 pm »
For the percent function the result is correct: 9 -10% = 9 - (9 * 10/100) = 9 - 0.9 = 8.1. I don’t recall it ever working otherwise.
I'm not a calculator aficionado, but as I see it, the problem is 10% of what? Normally 10% should be converted to 0.1, usually to be used with multiplication.
In windows standard calculator (% is absent in scientific) it happens just as op described when doing subtraction/addition. But if you do multiplication or division, it simply converts 10% to 0.1. My Casio fx-83ES converts it to 0.1 regardless of what you do. But with latter you enter a full expression rather doing a single operation with a known number.
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 21462
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: A warning to engineers about calculators
« Reply #9 on: December 14, 2024, 05:43:35 pm »
The notion that calculation precision is the same as display precision, if true, is certainly a giant red flag.

For engineering, I agree - but other domains might well be different.

The first place I would look for that is finance/accounting/insurance and similar. A big hint is that while there are many different types of rounding, bankers/accountants have their own mode requiring "round to nearest, ties to even". They get irritated with software that doesn't do that.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 
The following users thanked this post: tooki

Offline mqsaharan

  • Regular Contributor
  • *
  • Posts: 135
  • Country: pk
Re: A warning to engineers about calculators
« Reply #10 on: December 14, 2024, 05:48:15 pm »
Can it be set up to do RPN?  That might avoid the problems reported here.

yes, it can.
 

Online wraper

  • Supporter
  • ****
  • Posts: 18047
  • Country: lv
Re: A warning to engineers about calculators
« Reply #11 on: December 14, 2024, 05:48:41 pm »
BTW google online calculator calculates 8.1 as well with entire expression entered.
« Last Edit: December 14, 2024, 05:51:59 pm by wraper »
 

Offline Russ_ATopic starter

  • Contributor
  • Posts: 20
  • Country: ca
Re: A warning to engineers about calculators
« Reply #12 on: December 14, 2024, 05:51:40 pm »
The calculator app I'm referring to shows full expressions, with symbology and everything. So yeah, % is just shorthand for divide by 100. It should have nothing whatsoever to do with anither term in the expression. The developer told me:

Hi,

The result is correct. If you add or subtract a percentage, it is always added or subtracted from some base. In your case it is subtracted 10% out of 9 which is 8.1.

The operation that just divides the number of percents by 100 is totally useless.

Best regards,
Jindřich

As you can see they have no idea how to evaluate a simple mathematical function. Type that into any full expression calculator, from programming languages, to Excel, to scientific calculators, to graphing calculators and % just means divide by 100. That the calculator automatically puts brackets around the term makes it even worse. I've attached some images that shows how it lets you input the function. It's beyond misleading, it's just wrong. It removes the blue brackets when you hit enter to evaluate the expression. I've attached screenshots.
 

Online wraper

  • Supporter
  • ****
  • Posts: 18047
  • Country: lv
Re: A warning to engineers about calculators
« Reply #13 on: December 14, 2024, 05:55:03 pm »
The calculator app I'm referring to shows full expressions, with symbology and everything. So yeah, % is just shorthand for divide by 100. It should have nothing whatsoever to do with anither term in the expression. The developer told me:

Hi,

The result is correct. If you add or subtract a percentage, it is always added or subtracted from some base. In your case it is subtracted 10% out of 9 which is 8.1.
If developer is wrong, google is wrong too. So I guess you need to prove google being wrong first before putting any blame to that developer.

« Last Edit: December 14, 2024, 05:58:54 pm by wraper »
 
The following users thanked this post: Someone, thm_w, eutectique

Offline Russ_ATopic starter

  • Contributor
  • Posts: 20
  • Country: ca
Re: A warning to engineers about calculators
« Reply #14 on: December 14, 2024, 05:57:00 pm »
The problem is that it's misleading. You set 15 digits of precision in the settings but if at any point you change to fixed digit display while using the calculator you've lost your precision. Who would even program it that way? It's like they're using a string to store numbers for calculations rather than using a proper variable which goes through a format function when displayed onscreen.
 

Offline Russ_ATopic starter

  • Contributor
  • Posts: 20
  • Country: ca
Re: A warning to engineers about calculators
« Reply #15 on: December 14, 2024, 05:59:49 pm »
I thought I'd also point out the flaw with ran#, which outputs a random decimal between 0 and 1. Hitting enter over and over gives 0 some of the time and something else some of the time.
 

Offline KE5FX

  • Super Contributor
  • ***
  • Posts: 2113
  • Country: us
    • KE5FX.COM
Re: A warning to engineers about calculators
« Reply #16 on: December 14, 2024, 06:02:13 pm »
The notion that calculation precision is the same as display precision, if true, is certainly a giant red flag.

For engineering, I agree - but other domains might well be different.

The first place I would look for that is finance/accounting/insurance and similar. A big hint is that while there are many different types of rounding, bankers/accountants have their own mode requiring "round to nearest, ties to even". They get irritated with software that doesn't do that.

Sure, but rounding implies that there is precision beyond what's visible.  Otherwise you're just truncating, right?  To round the LSD up or down, you need at least one more digit beyond what you ultimately display.
 

Offline Russ_ATopic starter

  • Contributor
  • Posts: 20
  • Country: ca
Re: A warning to engineers about calculators
« Reply #17 on: December 14, 2024, 06:13:35 pm »
Yeah, a lot of calculators screw up %, but mot ones at this level of expression evaluation. This calculator shows stuff like I've attached below. It calculates % one way and then it changes its mind and does something else. And as I posted above the bracket thing is crazy. The calculator pretty much tells you that % is a function like any other and then it does some wild crap where it's doing the math differently. This is whackadoodle.
 

Offline Russ_ATopic starter

  • Contributor
  • Posts: 20
  • Country: ca
Re: A warning to engineers about calculators
« Reply #18 on: December 14, 2024, 06:27:36 pm »
I know I can't see the code but this reeks of using strings to store numbers. They just output the string to the display amd use the same thing in the calculations. That's not how a fancy graphing (yes, this app does graphing too) and scientific calculator should work or be expected to work. See the attachment. I've brought up the display option, which is a button on the calculator. If you choose fixed display it truncates the number and loses the precision you had. Now whether or not you agree or disagree with the things I found as soon as Instarted using the app ut's super obvious that whoever's programming this doesn't give a rat's ass about accurate calculations. They don't care and they feel it's not important because such a fundamental flaw is baked into the inmer workings of the program.
 

Offline jpanhalt

  • Super Contributor
  • ***
  • Posts: 4077
  • Country: us
Re: A warning to engineers about calculators
« Reply #19 on: December 14, 2024, 07:04:28 pm »

The result is correct. If you add or subtract a percentage, it is always added or subtracted from some base. In your case it is subtracted 10% out of 9 which is 8.1.


Judging from the number of people who thought the OP meant that result was wrong, perhaps this thread should be retitled: "A warning to engineers about calculators English." :)
 

Online coppice

  • Super Contributor
  • ***
  • Posts: 10167
  • Country: gb
Re: A warning to engineers about calculators
« Reply #20 on: December 14, 2024, 07:06:52 pm »
That calculators days are numbered.
Like the 32nd of the month?

I think accuracy really counts in a calculator. I mean you don't want to run an important calculation, and have the calculator do a number on you.
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 12570
  • Country: us
Re: A warning to engineers about calculators
« Reply #21 on: December 14, 2024, 07:10:51 pm »
Why do you title this thread "a warning about calculators", instead of "a warning about a specific phone calculator app I don't like"?
 
The following users thanked this post: Psi, ivo

Offline IanB

  • Super Contributor
  • ***
  • Posts: 12570
  • Country: us
Re: A warning to engineers about calculators
« Reply #22 on: December 14, 2024, 07:33:28 pm »
And the last one I found was with its use of %. When typing an expression it'll put brackets around the number when you type in %, so you type 9 - 10 % and it'll have 9 - (10)% for the expression on the display. Seems great, right? What a good way to clarify what's going on. Wrong. That evaluates to 8.1. No kidding. I've been in contact with the developer and they're claiming that's the correct way of doing percentages. They just have no idea what they're doing. I explained that % should always be the same as /100 but they don't believe me.

I just did 9 - 10% on the iOS calculator and I got 8.1. I also did 9 - 10% on the HP 42s and got 8.1. Then I did it on the HP 35s and got 8.1.

I would be very disappointed in any of these calculators if I didn't get the expected answer of 8.1.
 
The following users thanked this post: thm_w, tooki, eutectique, RAPo, ivo

Offline Russ_ATopic starter

  • Contributor
  • Posts: 20
  • Country: ca
Re: A warning to engineers about calculators
« Reply #23 on: December 14, 2024, 07:58:38 pm »
If you type 10% into a calculator and it results in 0.1 then you've taken 10% of what? It's gotta be ten per cent of 1, so 10/100*1 or just 10/100. If the calculator is designed to take 10% added or subtracted from some other term then 10% on its own shouldn't result in anything because 0+10% would be 0 and 1+10% would be 1.1 The % function should either require one parameter or two but not some random mix of both. 10% means 0.1. And the way this app shows brackets and weirdness around what it's actually doing is nuts. I think the developer is just grabbing function definitions off some website and chucking it into their app and not really understanding how it should work. And it results in this calculator doing the math differently than pretty much every physical scientific/graphing calculator out there. I've never seen a full expression calculator do it any other way. The ones that do stepwise calculations have a bit more leeway because they're using the full result of the previous calculation as one of the inputs to their % function. The app you showed is one of those, and yeah I do have a problem with the way the expression is shown onscreen by the end there. It's pretty much just displaying the order of button presses and not a proper formula.

I've said I've only been using this a day and found significant problems with it in other areas so it's not just this one thing. They've implemented hundreds of functions and it wouldn't surprise me at all if there are other serious issues.
 

Offline SteveThackery

  • Frequent Contributor
  • **
  • Posts: 863
  • Country: gb
Re: A warning to engineers about calculators
« Reply #24 on: December 14, 2024, 08:09:50 pm »
With great respect, I think @Russ_A's expectation might be in a minority. The Windows standard calculator and the Android one both give 8.1 as the answer to 9 - 10%.

So far it looks like every calculator tested assumes "10% of 9" is what the user wants.

If the calculator is designed to take 10% added or subtracted from some other term then 10% on its own shouldn't result in anything because 0+10% would be 0 and 1+10% would be 1.1.

Hipercalc, the Android calculator and the Windows calculator all behave as described in bold.

This is a fascinating thread - I had no idea about the loss of precision.  Thanks, @Russ_A.
« Last Edit: December 14, 2024, 08:27:07 pm by SteveThackery »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf