Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Interesting how Microsoft and Google have different ideas of how percentage key (%) should work.

Relevant post by Raymond Chen:

“How does the [Windows] calculator percent key work?”

http://blogs.msdn.com/b/oldnewthing/archive/2008/01/10/70474...

Implementing % button, Google chose an approach which is more mathematically sensible but arguably less obvious to users. For Google, 10% just an alias for 0.1. This means that if you want to calculate how much a dress with a price of $299 costs with a 20% discount, type in

  299 + 299 × 20%
Perhaps, this is exactly how you think % should work.

Microsoft, however, chose to make “%” key more user-friendly, perhaps sacrificing some consistency. Windows calculator tries to use the last computed value as “the whole”. Therefore,

  299 - 20%
will give you how much a $299 dress costs with 20% discount, and

  299 + 5% - 20%
will help you calculate 5% tax before applying the discount.

Sadly, Google thinks

  500 + 1% = 500.01
which is really not that helpful.


I don't get it, if i try 500 + 1% on Google i get 505 http://sadpanda.us/images/1112074-RA9OURZ.png


You get a different result if you click the buttons versus performing a google search.


which I think it is exactly how I would expect it to work: If I ask a question, I expect the system to guess what I really want to know and give me an answer.

But a calculator should work like a calculator.


Still a pretty big inconsistency.

500 + 1% typed right in calculator displays "500 + 1% = 500.01" in the calculator.

500 + 1% typed in the search box displays "500 + 1% = 505" in the calculator too.

It's probably due to the search result being returned by some server at Google while the other one is computed locally through some client-side JS logic. I think they'll notice and unify the behavior at some point.


"But a calculator should work like a calculator."

Yes, and no physical calculator I have ever seen would give 500.01 for "500 + 1%".


The way Microsoft did it is the same way most physical calculators I've seen work.


I just tested it and the percent key in the Google calculator doesn't work like the one described in the linked article. It really just divides by 100.

3 + 5% = 3 + 0.05 = 3.05


Sorry, I just reworded my comment to make it more clear.

This article is about Windows calculator and I'm comparing two different approaches.

Google went with simple 10% = 0.1 here, like you say.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: