4 ms·
Percentage. But in the code I'd probably use X_range depending on what 0..1 represents
by eithed 6y ago
Percentage.
But in the code I'd probably use X_range depending on what 0..1 represents
- Tainnor 6y agopercentage is 0 to 100, though. (Or even more, saying 200% is not technically wrong depending on context)
- eithed 6y agoDepends how you look at it, I guess. 0 to 100% translates to 0 to 1. edit: but I guess it is wrong, because % is ambiguous - it can mean fraction, it can mean growth
- Tainnor 6y agoThat's like saying that inches are the same thing as yards because you can convert from one to the other.
- Izkata 6y agoWhat 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.
- Tainnor 6y agoSo 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?
- eithed 6y agoNo, 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.
- deleted 6y ago[deleted]