Live data from Hacker News

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

english.stackexchange.com

71–80 of 325 posts

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

#71

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?

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

#72
post #55

Earlier quoted context omitted.

UnitInterval is the type. The name of the value should reflect its specific use.

Exactly. The best usage for this would be something like: typedef float UnitInterval; void do_something_accurately(UnitInterval accuracy);

This is the correct answer IMHO. (The variable name could also be "proportion" or "probability" depending on context, and the type name could more precisely be ClosedUnitInterval, but the idea of putting it in the type is IMHO correct.)

I don't know much about C (? I assume that's what this is), but in other languages you can even build a wrapper type and enforce invariants in construction if really necessary.

Of course, all that ceremony only makes sense if this is really a type you use multiple times. Otherwise I wouldn't bother.

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

#73

"Normalized". That's what we call data that have been scaled to fit on a tidy axis.

One problem with the word normalised is that it implies that there is some true original value from before normalisation that isn't necessarily between 0 and 1. Of course if that's true then the word is ideal, but if not then it's confusing.

Genuine question, i'm no math expert: if you're using the value by multiplying it with some other value, does that not imply it qualifies as normalised?

i.e. say you have a width of 500 and you want to move half way across so you have this value of 0.5 to get 250. By dividing 250 by 500, aren't we in fact normalising it?

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

#74
post #45

I like that the top-voted answer is a wrong one. (A unit interval is the set [0, 1], whereas the asker wants to know a name for an element of it.)

Yeah, this is a pretty significant difference between a set and an element.

The fix is simple: Put the type of the variable in the type name. Then "UnitInterval proportion" tells you everything you need to know.

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

#75
As the logic dealing with {0, 1} is named after its founder George Boole, a boolean or bool for short.

I'd suggest we call a fuzzy truth value in the interval of [0,1] after its founder Lotfi A. Zadeh, a zadehan or zade for short.

Edit: Fixed Bool to Boole thanks to globular-toast, my internal syntax checker must have auto corrected that one ;)

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

#76
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)?

Practically? float/double. You probably don’t need any more precision and maintaining easy interoperability is more important.

Otherwise you just want the mantissa stored as an int or byte[] until you need it to be converted to a floating point number.

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

#78

I typically use "_fraction" to indicate this in floating point variable names, along with a comment explicitly mentioning the range from 0 to 1 somewhere. Seems to minimize confusion pretty well.

I’ve also seen “fraction” used for this concept in Apple/NeXT APIs. E.g., “-[NSImage drawInRect:fromRect:operation:fraction:]” and “-[UIViewPropertyAnimator fractionComplete]”.

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

#80

"Normalized". That's what we call data that have been scaled to fit on a tidy axis.

That's what I use, too: "normalized floats." I would prefer a better word, though. I work a lot with audio, and "signed normalized floats" doesn't exactly roll off the tongue.
Post reply on HN