Live data from Hacker News

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

english.stackexchange.com

301–310 of 325 posts

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

#301
post #258

Earlier quoted context omitted.

Yes, I was thinking something like proper ratio but I don't think that's standard plus I think it's getting pedantic. The takeaway is words are mostly a leaky abstraction, imperfect model for math concepts. But I guess if you're a clever programmer you could call it a ThielAccuracy, or ThielRatio

Maybe part_ratio? Because you can never take a bigger part than 100%.

Yeah, I like that. Or fractional_ratio. With part_ratio tho I'm still not sure which part... (the lesser or greater than 1) part. But I like it because it's shorter. Frac_ratio feels like cheating a bit.

But I guess a number that's always between 0 and 1 is an integer reciprocal. But again that's probably getting too deep for this.

I guess another way is UnitIntervalPoint or ProperFraction

I guess in Java we don't have to choose

FractionalPartRatioForAccuracyNormalized hehehe

I suppose we could make up a word

bition, or bitum

anabit or cobit - analog bit (continuous on 0 to 1)

proratio - proper ratio

Making up a word seems easier than the rest because it's more concise. :)

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

#302

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…

A fraction or proportion in general doesn't have to be representable as a ratio of natural numbers. That's called a "common fraction", and as it happens, floating point representation stores the value as a ratio of natural numbers anyway. It's like asking someone to cut you 1/pi of a pie. It isn't total nonsense, but it is weird and you're going to get an approximation. They might get confused by your odd request and give you half a pie instead a third of a pie though!

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

#303

I propose "pun", as a neologism, for brevity. Easy to postfix. "Proportion of Unity" "Proportion of Unity, Normalized". "P(er) Un" or "Perunage" contracted. Short, doesn't clash hard with other meanings, is its own mnemonic. AccuracyPun would be accuracy as a proportion of one. femPop might be 8000, but femPopPun would have to be [0,1].

That violates my organization's NAP, or "No Acronym Policy". No way I'll get an LGTM on any PR that includes that!

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

#304
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 writi…

You're likely thinking of subnormal or denormal numbers, which helps floating point representation better represent tiny numbers near zero. The typical floating point number is normalized so that it's 1.xxxx*base^exponent. Since the 1 is always there, it is made implicit as a rule and only xxxx and exponent is stored in memory. There's a limit to the range of the exponent, though, and so for very tiny numbers near zero, the exponent is capped at its smallest value and the rule changes to have an implicit 0 instead of 1. Then, you can get a few more orders of magnitude 0xxx, 00xx, 000x, etc. You gradually trade significant digits for more negative exponents.

I don't think it really helps for the interval 0 to 1, but rather for the interval 0 to 0.000000000000000000000000000000000001 or whatever. It doesn't give you more significant digits, but rather a gradual degradation of significant digits as they get used for exponents.

Subnormal numbers are a bit controversial because of their relative utility vs. added complexity to implement them, especially in hardware.

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

#305

Earlier quoted context omitted.

Is there a difference between ≤ and <= in Raku? Curious why you used ≤ in your example.

They're equivalent, Raku defines both Ascii compatible and Unicode names for typical operators. I expect they used ≤ because it looks nicer.

Yep, correct on both counts

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

#306
post #292

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)

LISP had the convention of appending "p" for predicate: (evenp x) would return true if x was even. So, "positivep". Though, yeah, that would be the name for a function that checks whether the argument was positive, not a flag.

Common Lisp calls it plusp.

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

#307

Earlier quoted context omitted.

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

Good ideas. But I messed up my own example. The one I was reaching for was a flag to set “clockwise or anti clockwise or neither” I was looking for the terminology for clockwiseness

In mathematics, by a widely used convention, a clockwise rotation is negative.

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

#308
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 work in games where these values are extremely common and 'accuracy' wouldn't be very descriptive in a lot of circumstances: explosion radius falloff damage, water flow strength, positional/rotational lerps or easing, and more.

I wish I were commenting here with an answer, but I don't have one. "brightness01" is a common naming convention for values of this type in computer graphics programming, but niche enough that it got raised in review comments by another gameplay programmer.

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

#310
post #282

I would love to have a symbol that represents this unit scale as an analogue to '%'. I.e. you could say 33% or 0.33x where where 'x' indicates a normalized decimal from 0.0 to 1.0.

There was the "uno" proposal. https://en.wikipedia.org/wiki/Parts-per_notation#Uno I'm glad it never caught on.

Interesting, although that goes the other way, indicating different degrees of implied scaling (rather than none). If you were labeling a header or axis on a chart, or naming a variable you'd probably include the word "decimal", "fraction", or "scalar".
Post reply on HN