Live data from Hacker News

A word for a value between 0 and 1 (inclusive)

english.stackexchange.com

141–150 of 325 posts

Re: A word for a value between 0 and 1 (inclusive)

#141

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?

Looked it up, and a 'perunage' is defined as 'a percentage divided by a hundred'.

Re: A word for a value between 0 and 1 (inclusive)

#142
post #67
post #57

I 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.

Really the percentage sign just denotes a centi-1. Just like a centi-meter is 1 hundreths of the unit 'a meter', a percentage is 1 hundreths of the a (unitless) unit '1'.

Re: A word for a value between 0 and 1 (inclusive)

#143

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,…

One of the answers was edited to “portion”, which is the same idea, I think either portion or proportion is elegant and simple. If anyone has been using proportion then I’d stick with that, though portion is nice and succinct.

Re: A word for a value between 0 and 1 (inclusive)

#144

Earlier 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"

[deleted]

Re: A word for a value between 0 and 1 (inclusive)

#145
post #69

Related 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)?

I would want to keep this stored as a float.

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)

#147

Earlier 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 = Vector

Re: A word for a value between 0 and 1 (inclusive)

#149

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?

Latin for one is ūnus, so percent -> perun would be logical, those sensible Dutch ...

Re: A word for a value between 0 and 1 (inclusive)

#150
If your language supports it you could do

  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)
Post reply on HN