Live data from Hacker News

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

english.stackexchange.com

111–120 of 325 posts

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

#111
post #87
post #66

Earlier quoted context omitted.

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

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

It’s 1, but is it a mantissa?

The linked Wikipedia article just says that the mantissa is “the fractional part.”

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

#113
post #44

Does anyone know of a good site for these kind of questions other than the English stack exchange. I frequently run into programming related naming issues (who doesn't eh?). But I struggle to find accurate search terms to help answer them...and the results are usually downed out by non-technical related language Q&A's E.g. I was trying to name a table yesterday that would store events related to boxes, pallets, conta…

Yes naming things is difficult and we would all benefit from shared names for the same things.

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

#116
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.

I like this idea of using the type name to define the domain, and variable name to define the purpose.

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

#117
post #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 yo…

I'm envisioning a programming language in which variable names and type names can become one. So instead of func call(Person person){} you just have func call(person){} where person is a known type AND the variable name. In that scenario 'accuracy' would be a type with known value between 0 and 1.

what if you have to deal with two persons?

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

#118

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)

UnitInterval seems to contains an interval, not a single float. I don't think it's a very good name.

UnitIntervalNumber would be better, but it's too long. Something like UnitNumber or UnitFloat could maybe work.

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

#119
post #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 yo…

That's a very good observation. We still could need a (new) term for this common type. Maybe floatbit, softbit, qubit(sic), pot, unitfloat, unit01 or just unitinterval as suggested? This begs an interesting tangential question: Which programming languages allow such resticted intervals as types? type percentage:=int[0,100] type hexdigit:=int[0,15] … since this might be overkill, sane programming languages might encou…

floatbit is good starting idea, but maybe too long to be catchy. How about a flit?
Post reply on HN