Live data from Hacker News

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

english.stackexchange.com

81–90 of 325 posts

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

#82
post #68
post #65

Percentage. But in the code I'd probably use X_range depending on what 0..1 represents

percentage is 0 to 100, though. (Or even more, saying 200% is not technically wrong depending on context)

Depends 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

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

#83
post #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 ;)

*George Boole.

I like this idea, although I don't think English speakers would know how to pronounce "zadehan" by default. "Zadean" might be better. I don't think it will catch on, though, because "boolean" is really easy to say but "zadean" isn't.

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

#84

Depending on context I would use ratio saturated (if something is clamped to 0-1) normalized (if it is scaled down using a max value)

I don't like "ratio" because, though this might just be me, I already have a bad habit of assuming, incorrectly, that every ratio in my code is meant to stay smaller than +1.

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

#85

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

I thought this too, so you’re not alone. I’ve been very surprised to learn what a small minority we are.

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

#86
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'm not an expert on the ins-and-outs of floating-point numbers, but I've always heard fp types have a disproportionately large amount of their accuracy at values What I do wish the languages I used had support for, is number types that the user could clamp to a specific range. It would be nice to have my code throw an error if some function resulted in clipped audio, for example. I mean, without the programmer writing any extra code, of course.

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

#87
post #66
post #2

“mantissa” ( https://en.wikipedia.org/wiki/Common_logarithm#Mantissa_and_... ) comes close, but excludes 1. IEEE 754 sort-of has that as a part of a float, too ( https://en.wikipedia.org/wiki/Significand ), and people use the term “mantissa” for it, but it has to special-case 0. ⇒ barring better suggestions, I think I would stretch the definition of mantissa a bit further.

Can we just represent 1 here as 0.999...?

There are many ways to represent 1, but it’s still 1.

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

#88
post #74
post #45

Earlier quoted context omitted.

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.

That's three words though, and the SO OP asked for a single word.

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

#89
post #79

I use "alpha" for this, as in A in RGBA. Obviously won't work for everyone, but it's a simple convention that's easy to grok and explain.

I like this a lot, given how often it's used in scenarios similar to alpha blending, like "reducing the proportion of X".

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

#90
I don't think this is a naming issue at all. In the provided example, 'Accuracy' is the correct name for the parameter, as that's what the parameter represents, accuracy. The fact that accuracy should be given as a value in an interval from 0 to 1 should be a property of parameter type. In other words, the parameter should not be a float, but a more constrained type that allows floats only in [0,1].

EDIT: Some of you asked what about languages that don't support such more constrained types, so to answer all of you here: different languages have different capabilities, of course, so while some may make what I proposed trivial, in others it would be almost or literally impossible. However, I believe most of the more popular languages support creation of custom data types? So the idea (for those languages at least) is quite simple - hold the value as a float, but wrap it in a custom data type that makes sure the value stays within bounds through accessor methods.

Post reply on HN