Live data from Hacker News

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

english.stackexchange.com

211–220 of 325 posts

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

#211
Is there a resource for "help naming stuff"? Naming is hard. Especially so when you dabble in domains you're not learned in. I have almost no math background so sometimes I really struggle to know what to name things.

My latest example is, "I need to provide a flag to switch if this element is positive or negative. What do I name the flag?" (came up with simply: sign, or polarity)

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

#214
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…

Is there an example, in any language, showing how you would represent this at the type level? I can’t see how you would do it.

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

#215
post #203

Earlier quoted context omitted.

That's like saying that inches are the same thing as yards because you can convert from one to the other.

What I was taught in school is that "percent" doesn't refer to 0 - 100, it refers to 0% - 100% which is equal to 0 - 1 (not really a conversion, actually equal). As 0% and 100% aren't floats (they're more like formatted values), seeing AccuracyPercent in the question had me thinking there was nothing more accurate.

So if you build a tax calculator and add a field with the label "Please add your tax rate in percent" you expect people to enter a value between 0 and 1?

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

#216
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…

> However, I believe most of the more popular languages support creation of custom data types? No, most don't, except if you go into building custom classes.

So, most don't support custom types unless you...use the mechanism they have for defining a custom type?

That seems a very elaborate way to say “No" when the answer is really “Yes”.

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

#219

Is there a resource for "help naming stuff"? Naming is hard. Especially so when you dabble in domains you're not learned in. I have almost no math background so sometimes I really struggle to know what to name things. My latest example is, "I need to provide a flag to switch if this element is positive or negative. What do I name the flag?" (came up with simply: sign, or polarity)

For booleans I generally stick to the `isX` format. So in your case, `isPositive` (or `isNegative` depending on your preference)

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

#220

I've called this 'unit real' in the past, but wasn't happy with it. 'Portion' is good, from one of the answers. ('Proportion' and 'fraction' unfortunately both suggest a ratio of integers instead of a unit real. It'd sure be convenient if these two different words weren't fixed to that same meaning.) For neologisms, 'tweening' comes to mind. (Think of the coefficient of a convex combination. 'Tweenness' feels just a…

> Booleans have the same problem that we lack a plain English short word for "yes or no answer". "Binary" is the term I use. E.g., "It's not a binary proposition" to call out a false dichotomy.

Binary means that there are exactly two choices, not that the choices are yes or no.
Post reply on HN