Hacker News new | past | comments | ask | show | jobs | submit login

That's like saying that inches are the same thing as yards because you can convert from one to the other.



What I was taught in school is that "percent" doesn't refer to 0 - 100, it refers to 0% - 100% which is equal to 0 - 1 (not really a conversion, actually equal).

As 0% and 100% aren't floats (they're more like formatted values), seeing AccuracyPercent in the question had me thinking there was nothing more accurate.


So if you build a tax calculator and add a field with the label "Please add your tax rate in percent" you expect people to enter a value between 0 and 1?


No, but you're defining a unit here; I'd expect people to put in values as 0..100 with unit being percent. So if a person puts in 20, and you'll want to multiply it by 3, you'd not expect 60 as end result; you'd expect 60% which is 0.6

You're still raising valid point with the ambiguity - if I were to see a variable named `population_percentage = 0.01` I'd still need to ask the author if the intended value here is 1 or 0.01, which I'd say disqualifies this naming.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: