Shoot. I thought "Proportion" was the One True Correct word, but it's not. Float values between 0 and 1 are very very useful, and I use them all over the place, and I actually thought everyone did (and everyone called them 'Proportions') Unlike percentages, you can just multiply them with the number you want the 'proportion' of, Quick, how do you calculate 20% of 50% of 12345!? (it's (20/100) * (50/100) * 12345) Ok,…
It makes most sense in formulas: Instead of x=(foo/100) * (bar/100) * baz you can do x=foo * bar * baz. Which is rather more readable! Probabilities in statistics are also expressed in this manner. Meanwhile I found out that the Dutch dictionary actually has Perunage for this usage, especially in finance. So maybe that's he term I'll start using?
A word for a value between 0 and 1 (inclusive)
141–150 of 325 posts
Re: A word for a value between 0 and 1 (inclusive)
#142I heard percentage (0-100), promillage (0-1000, per mille) and perunage (0-1) in school. This was not in an English speaking country. So for me "perunage" sound very logical. "Un" means one in French (cent=100 and mille=1000).
While percentages are denoted as numbers between 0-100, they actually represent numbers between 0-1. Though you can have things like 120% so it's not perfect.
Re: A word for a value between 0 and 1 (inclusive)
#143Shoot. I thought "Proportion" was the One True Correct word, but it's not. Float values between 0 and 1 are very very useful, and I use them all over the place, and I actually thought everyone did (and everyone called them 'Proportions') Unlike percentages, you can just multiply them with the number you want the 'proportion' of, Quick, how do you calculate 20% of 50% of 12345!? (it's (20/100) * (50/100) * 12345) Ok,…
Re: A word for a value between 0 and 1 (inclusive)
#144Earlier quoted context omitted.
Again, this is bike shedding bait. I'm going by my own experience with basic mathematics in my American education where "percent" is something you multiply a number by, and usually ranges from 0 to 1. Ex. 50% of 12 marbles is 6 (*.5, 50%). But just looking at all the different answers in the comments here means there's no consensus on a "right" way. Hence bike shedding. A decent code base should be consistent so it c…
There might be bike shedding for the best answer, but this is just incorrect. Percent literally means "for one hundred"
Re: A word for a value between 0 and 1 (inclusive)
#145Related question: what would be the best way to store such a value? A float would only use the mantissa-bits, so it would be rather inefficient. Perhaps as a uint16 with a representation of uint16 / (2^16)?
Because chances are, I am going to be multiplying other floats by this number. And the performance penalty (not to mention the maintenance penalty) of converting back-and-forth between whatever you choose and floats will probably out-weigh the gains of storing it efficiently.
That said something like a uint would probably be most efficient if you did care. At that point, allignment issues also start cropping up performance wise.
Re: A word for a value between 0 and 1 (inclusive)
#146function FuncName(float AccuracyBoolean)
function FuncName(float BoolAccuracy)
function FuncName(float IsAccurate)
Re: A word for a value between 0 and 1 (inclusive)
#147Earlier quoted context omitted.
yeah, right, so what do you call such a type? I believe that is the actual question.
The question was about the parameter name , though. The correct answer seems to be: function FuncName(UnitInterval accuracy)
function FuncName(NormalizedFloat accuracy)
In languages with operator overloading you can make NormalizedFloat a proper class with asserts in debug version and change it to an alias of float in release version.Similarly I wonder why gemoetry libraries don't define separate Point class and Vector class, they almost always use Vector class for vectors and points.
I understand math checks out, and sometimes you want to add or multiply points, for example:
Pmid = (P0 + P1) / 2
But you could cast in such instances: Pmid = (P0 + (Vector)P1)/ 2
And the distinction would surely catch some errors. Point - Point = Vector
Point + Point = ERROR
Vector +/- Vector = Vector
Point +/- Vector = Point
Point * scalar = ERROR
Vector * scalar = Vector
Point */x Point = ERROR
Vector * Vector = scalar
Vector x Vector = VectorRe: A word for a value between 0 and 1 (inclusive)
#148"zeroToOne" includes both values. "Given a number from zerotoone..."
Re: A word for a value between 0 and 1 (inclusive)
#149Shoot. I thought "Proportion" was the One True Correct word, but it's not. Float values between 0 and 1 are very very useful, and I use them all over the place, and I actually thought everyone did (and everyone called them 'Proportions') Unlike percentages, you can just multiply them with the number you want the 'proportion' of, Quick, how do you calculate 20% of 50% of 12345!? (it's (20/100) * (50/100) * 12345) Ok,…
It makes most sense in formulas: Instead of x=(foo/100) * (bar/100) * baz you can do x=foo * bar * baz. Which is rather more readable! Probabilities in statistics are also expressed in this manner. Meanwhile I found out that the Dutch dictionary actually has Perunage for this usage, especially in finance. So maybe that's he term I'll start using?
Re: A word for a value between 0 and 1 (inclusive)
#150 function FuncName(Bound Accuracy)
...or if it doesn't function FuncName(BoundFloat0_1 Accuracy)
...or if it's dynamically typed function FuncName(AccuracyBoundFloat0_1)
...or if mentioning the bounds explicitely is too verbose/YAGNI for your taste function FuncName(UnitIntervalFloat Accuracy)