Hacker News new | ask | show | jobs
by jwmoz 488 days ago
Not a calculator engineer but this seems hideously complex?
4 comments

Maybe, though in the paper (not the article):

> We no longer receive bug reports about inaccurate results, as we occasionally did for the 2014 floating-point-based calculator

(with a footnote: This excludes reports from one or two bugs that have now been fixed for many months. Unfortunately, we continue to receive complaints about incorrect results, mostly for two reasons. Users often do not understand the difference between degrees and radians. Second, there is no standard way to parse calculator expressions. 1 + 10% is 0.11. 10% is 0.1. What’s 10% + 10%?)

When you have 3 billion users, I can imagine that getting rid of bugs that only affect 0.001% of your userbase is still worthwhile and probably pays for itself in reduced support costs.

I’m confused. Why would 1 + 10% obviously be 0.11?

I expected 1.1 (which is what my iOS calculator reported, when I got curious).

I do understand the question of parsing. I just struggle to understand why the first one is confidently stated to correctly result in a particular answer. It feels like a perfect example itself of a problem with unclear parsing.

> 1 + 10% is 0.11.

I know adding % has multiple conventions, but this one seems odd, I'd interpret 1 + 10% as "one plus 10 percent of one" which is 1.1, or as 1 + 10 / 100 which happens to be also 1.1 here

The only interpretation that'd make it 0.11 is if it represents 1% + 10%, but then the question of 10% + 10% is answered: 0.2 or 20%. Or maybe there's a typo and it was supposed to say "0.1 + 10%"

1 + 10% could parse like the following:

(1+10)%

Which is 11% or 0.11

I think a big issue with how we teach math, is the casualness with which we introduce children to floating points.

Its like: Hey little Bobby, now that you can count here are the ints and multiplication/division. For the rest of your life there will be things to learn about them and their algebra.

Tomorrow we'll learn how to put a ".25" behind it. Nothing serious. Just adds multiple different types of infinities with profound impact on exactness and computability, which you have yet to learn about. But it lets you write 1/4 without a fraction which means its simple!

Totally agree. It bothered me when I was younger, though I had no idea how to explain why, but this should be deeply unsettling to everyone who encounters it:

    1/4 = 0.25      exact
    1/3 = 0.333...  infinitely repeating approximation

    1/1  a
    1/2  ah
    1/3  aH!
    1/4  ahh
    1/5  ah
    1/6  ahH!
    1/7  aHHHHHH!
    1/8  ahhh
    1/9  aH!
    1/10 ah
    1/11 aHH!
    1/12 ahhH!
    1/13 aHHHHHH!
    1/14 ahHHHHHH!
    1/15 ahH!
    1/16 ahhhh
    1/17 aHHHHHHHHHHHHHHHH!
    1/18 ahH!
    1/19 aHHHHHHHHHHHHHHHHHH!
    1/20 ahh
https://en.wikipedia.org/wiki/Repeating_decimal#Table_of_val...
Oh that number? It’s just a Laurent series. Just take the limit of the partial sums.
> For the rest of your life there will be things to learn about them and their algebra.

That’s just not true for the vast majority of people.

It's available to learn whether or not they take advantage of it.
Sure. Just like open heart surgery, Medieval English, and penguin husbandry.
There is no floating point here.
Real numbers are quite complex (no pun). Understanding the material well is a junior level math major course.

If you really understand the existing math curriculum this should be high school level.

For an everyday use calculator? Sure. It's still fun and challenging to create a calculator that can handle "as much" math/arithmetics as possible.
It’s really not just for experts though. Even dealing with fractions is going to require more than a naive implementation.