
A word for a value between 0 and 1 (inclusive) - polm23
https://english.stackexchange.com/questions/275734/a-word-for-a-value-between-0-and-1-inclusive
======
Sandman
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.

~~~
cloogshicer
I think this is the best answer.

This got me thinking: What about a situation where the accuracy is given in a
real-life unit. For example, the accuracy of a GPS measurement, given in
meters. I've sometimes used names like 'accuracyInMeters' to represent this,
but it felt a bit cumbersome.

Edit: Thinking more about it, I guess you could typealias Float to Meters, or
something like that, but also feels weird to me.

~~~
andrewaylett
More complex type systems absolutely support asserting the units of a value in
the type system. For example, here's an implementation of SI types in C++:
[https://github.com/bernedom/SI](https://github.com/bernedom/SI)

------
janee
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, containers and vessels and was looking for a generic name to
group them, e.g. goods_events, entity_events, object_events,
domain_object_events etc. but I had no idea how to phrase my question and not
get a bunch of junk back

Would be awesome if you could tweak some suggestion algo to be trained on
repo's specific to your domain and have it spit out suggestions based on human
language questions, e.g. gpt3 but focussed on some domain.

~~~
fastball
I use Power Thesaurus[1], which is crowd-sourced and frequently has words that
are well suited to technical use-cases.

In your case, I looked at synonyms for "containers" and found some likely
candidates such as "holders" or "receptacles", so `receptacle_events`.

[1] [https://powerthesaurus.com/](https://powerthesaurus.com/)

~~~
silviogutierrez
Thanks for the recommendation!

------
pwdisswordfish4
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.)

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

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

~~~
pwdisswordfish4
Names of types usually refer to individual members thereof: number, integer,
vector, string, list… A variable of a UnitInterval type would one that holds
unit intervals. This is no fix.

------
Someone
“mantissa”
([https://en.wikipedia.org/wiki/Common_logarithm#Mantissa_and_...](https://en.wikipedia.org/wiki/Common_logarithm#Mantissa_and_characteristic))
comes close, but excludes 1.

IEEE 754 sort-of has that as a part of a float, too
([https://en.wikipedia.org/wiki/Significand](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.

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

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

~~~
freyr
It’s 1, but is it a mantissa?

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

~~~
DavidSJ
The fractional part of x is what you have left after you subtract the largest
integer k ≤ x.

Hence the fractional part is always less than 1. Since 0.999... = 1, it is not
less than 1, so cannot be the fractional part of any number.

~~~
freyr
Makes sense, thanks.

------
smitty1e
"Normalized".

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

~~~
prox
I am trying to think of what the opposite word is of normalization.

~~~
kevingadd
In the spaces I work in, people just say denormalized / denormalization.

~~~
prox
That was easier than I imagined, thanks :)

------
sgtnoodle
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.

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

------
Kim_Bruning
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, now with 'proportions' 0.2 of 0.5 of 12345 :

Why, that's 0.2 * 0.5 * 12345 .

Am I actually the odd one out here?

~~~
Kim_Bruning
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?

~~~
rocqua
Looked it up, and a 'perunage' is defined as 'a percentage divided by a
hundred'.

~~~
Kim_Bruning
Which is indeed technically correct, and even an easy way to explain it the
first time.

Of course this rather undersells the elegance and simplicity of perunages, but
I'll take it.

~~~
FabHK
Not constrained to the interval [0,1], though: The change in the stockmarket
was -5 percent or -0.05 perunage today, but +300 percent or +3 perunage over
the last xyz years.

------
rocqua
I think I like portion. It is one of the only nouns that suggests an upper
limit of 1. The other contender is 'unitized'. I don't like normalized because
it feels too much like something that was actively normalized.

------
j-pb
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 ;)

~~~
dragonwriter
I'd only use Zadehan if it not only was a value on the interval [0, 1] but a
fuzzy membership value on that interval to which the Zadeh fuzzy logic
operators apply.

If it was a probability value to which Bayesian operators apply, Zadehan would
be a singularly inappropriate name for the type. Types aren't just ranges but
they also define the valid operations (whether syntactically functions,
methods, or operators) on the type.

~~~
j-pb
Sure, we can have both a zadeh, and a bayes ;)

I'm not sure if I find Koskos argument convincing, however one could also
argue that a bayes is a subtype of a zadeh ;)
[http://sipi.usc.edu/~kosko/Fuzziness_Vs_Probability.pdf](http://sipi.usc.edu/~kosko/Fuzziness_Vs_Probability.pdf)

~~~
dragonwriter
Bayesian probability is, from a certain perspective, _a_ fuzzy logic but the
operators of Bayesian logic are not the operators Zadeh’s fuzzy logic. Since
types define operators as well as values, I'd argue that a “bayes(ian)” type
should be distinct from a “zadeh(an)” type, even if they might usefully have a
common “fuzzy_membership” supertype.

------
donw
I would actually call this a bit of an antipattern.

`accuracy` seems fine to me -- although a more descriptive function name than
`FuncName` might suggest a better parameter name as well.

Digging through the dictionary to find the perfect word means that whoever
reads this code is likely going to have to do the same -- why would you ask
them to do that?

If you aren't referring to a common mathematical or physical concept, and the
word you need it isn't a part of your domain language, you're better off with
"accurate but slightly vague" over "almost precise" or "precise but obscure".

It seems like the author's need would be better met by readable tests, guard
conditions, and -- if this is part of an API -- documentation that describes
how `accuracy` is used.

~~~
nicky0
You're not wrong but it would be nice to have a word for this incredibly
common type of value still.

~~~
donw
As a mathematician, I heartily agree.

------
shadowgovt
Weird that it's been flagged as off-topic with no explanation. "I'm looking
for a word" seems very on-topic for an stack exchange about a human language.

~~~
jolmg
Among the comments:

> Naming variables is expressly off-topic here. This question, and the answers
> to it, are the perfect showcase of why. – RegDwigнt

The link "off-topic" in the notice eventually takes you to the help center
which states:

> But please, don’t ask any questions about the following topics. They are out
> of scope for this site.

> * Naming, including naming programming variables/classes

The question was edited, but the original version was about how to name a
variable.

That said, the reason why they're not allowed is not as apparent to me as it
is to the mod that made the comment quoted above.

~~~
gojomo
It seems every StackExchange site is overrun by sophomoric gatekeepers,
searching for (& competing with each other?) to find any possible reason to
shoot-down questions.

It's so much easier to hit that 'downvote' or 'close' button than to actually
try to understand the asker, or compose a meaningful answer, or even explain
clearly _why_ a question might truly need work.

So, I see a lot of 'closes' from people who hardly ever answer _any_
questions, and plenty by people who simply don't understand the question's
domain enough to see that yes, that _is_ a meaningful question with a compact,
well-matched answer. And once closed, it seems no one really looks at 'reopen'
requests, even after the question text improved.

~~~
tracker1
Not speaking to this question... but I largely don't even participate in
stackoverflow anymore as most questions seem to be what should be an RTFA,
have an existing answer, or homework help for what is way beyond the scope of
the site.

It's frustrating when 9/10 of the questions aren't even deserving of an answer
(at least that's my opinion) for the above reasons.

------
browserface
Ratio? Probability? Proportion?

Out of the answers there I like AccuracyNormalized best.

That immediately conveys (to me at least) what it is and what its magnitude
will be bounded by.

Or...if you were writing Java or Swift

NonNegativeMagnitudelessFractionalQuantity

~~~
dep_b
I always use ratio for this kind of number. Though it could be bigger than 1
since 120% == 1.2

~~~
browserface
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

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

~~~
browserface
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. :)

------
bridgeland
Given that no existing word is quite right for this common problem, a
neologism is best. And "primantissa" delights: I will smile every time I use
it.

~~~
FabHK
Naming the variable "accuracyPrimantissa" doesn't seem delightful to me,
though.

------
eps
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.

~~~
eru
Sounds a bit too much like alphabet or alphanumeric?

~~~
eps
Not to me. Especially when preceded by "float".

------
mannykannot
Anyone inclining towards the view that comments are harmful, as good code is
always self-documenting, should ponder the amount of debate that has already
gone into this one tiny issue.

------
FabHK
In times of COVID-19, I've seen quite some discussion about what the "R" in
CFR stands for. Whatever it stands for, that's the right answer :-)

Case fatality _ratio_ \- but not restricted to any interval

Case fatality _rate_ \- but doesn't have a time or derivative (rate of change)
component, which rates usually have

Case fatality _risk_ \- akin to probability, definitely between 0 and 1. That
would be my choice.

It's shorter than the word "probability", and somewhat less frequently used,
so it could be adopted for this purpose.

Edit to add: Though "accuracyRisk" does seem weird. Better than
"accuracyUnitInterval" though maybe.

------
terom
If 0-100 is a percent, then wouldn't 0-1 be a perun(something)?

I don't know latin, but perun, perune, peruni?

~~~
FabHK
Perunage, yes. Lamentably that is not restricted to [0,1], just as a
percentage isn't restricted to [0%, 100%] (look at the stock market return
over the last few days, and the last decade).

------
0xBA5ED
"float zero_to_one" is pretty short and obvious. The caller can maybe even
guess by the context of the function name that it probably accepts 0 and 1.

------
ramshorns
> between 0 and 1 (inclusive) [closed]

Why yes.

~~~
smlckz
lol. really a ''closed'' interval.

------
abecedarius
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 little too long.) 'Fractile' from
the stackexchange thread would also work.

Booleans have the same problem that we lack a plain English short word for
"yes or no answer". I think we ought to start pushing 'bool' or 'boole' out of
our jargon and into common English.

~~~
drdec
>'Proportion' and 'fraction' unfortunately both suggest a ratio of integers
instead of a unit real.

I don't mean to pick on you in particular abecedarius, but I find it amusing
to be worried about signalling that irrational numbers are OK given the
context is computing and all the numbers are rational anyway.

~~~
abecedarius
You got me there, but I think this kind of discussion is "you know what I
mean" territory: ratios aren't limited to 0..1, and the central examples the
terms evoke involve _small_ integers.

------
tobr
Is there a dictionary or thesaurus or something similar specifically designed
to help programmers name things? I run into questions like this all the time.
_“There has to be a commonly used word for this concept, but I don’t know what
it is”_

~~~
peterhil
Maybe there should be an IRC group #namingthings on Freenode?

------
cies
I heard percentage (0-100), promillage (0-1000, per mille) and perunage (0-1)
in school. This was not in an English speaking country.

So for me "perunage" sound very logical. "Un" means one in French (cent=100
and mille=1000).

~~~
proto-n
While percentages are denoted as numbers between 0-100, they actually
represent numbers between 0-1. Though you can have things like 120% so it's
not perfect.

~~~
cies
I did not mean it cannot exceed 1/100/1000.

> they actually represent numbers between 0-1

Not really. The often represents, for instance, a population of 100M, then 0
means 0, 1 (or 100%) means 100M and 1.2 (or 120%) means 120M (in case of
population growth).

~~~
proto-n
We are really arguing unimportant semantics here but I don't agree with you,
when you say 50% of the population, you are saying 0.5 of the population or
0.5 of 100M. The 50% always represents 0.5 when used correctly, in fact the %
sign is a different way of writing "/100" (with some artistic freedoms).

------
parliament32
I'd agree with "portion" or "part" \-- describes a percentage in decimal
notation, to me at least.

~~~
xvedejas
What about "fraction"? That's what I tend to use in my own code, although it
could be greater than 1 potentially.

~~~
sgtnoodle
That's a feature, in case you need to crank the power up to 11.

------
pftburger
Wouldn’t this be a normalized / unitized float?

Or at very least an absolute normalized float

------
ccleve
In my code, rather than use a generic term to describe the number, I try to
name what it actually represents in context. For example, if I'm scoring items
so I can rank them, and I need to normalize some number to do that, I'll call
it a "score" or a "rank".

Calling it a "proportion" or "ratio" or "normalized" is like calling a
variable "myinteger" or "myfloat". Your naming convention should be related to
a variable's purpose, not its data type.

------
mlthoughts2018
> “ Most things I can name easy enough, such as "Name" or "URL" or "MaxSizeN".
> The first 2 are self explanatory, the last one is the maximum size of
> something in relevant data units(as opposed to bytes or some other unit) but
> that one is easily understood by other programmers too.”

Programmers who think like this frighten me a lot. Those parameter names are
not self explanatory at all, and cannot be assumed readily understood by
developers picking up the code.

If you think “this is obvious” you need to add “to me” on the end, and “not
necessarily to other people.”

This can go off the rails when people start making braindead claims that code
should be self-documenting and need for comments or docstrings indicates poor
code. But it can also just lead to bad documentation where you think a word is
clear enough and you don’t realize others will cone into that segment of code
with totally different use cases or contexts in mind, assumptions about the
code’s usage constraints, different levels of skill and experience, different
levels of comfort with the natural language that comments are written in.

Over-communicating within documentation is a hugely beneficial thing. It only
costs a small amount of hassle for the person writing it and a small amount of
hassle dealing with the eyesore of it for people already familiar, but it
saves so much cognitive load for everyone else.

The main downside is keeping it up to date, but the false adage that wrong
documentation is worse than no documentation is no excuse.

------
Waterluvian
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)

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

~~~
Waterluvian
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

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

------
shultays
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)

~~~
uniqueid
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.

~~~
shultays
That sounds valid, no reason for ratio to be <= 1. It usually is but not
always I guess

------
darepublic
Creating a type that is defined as being between one and zero would be more
helpful and then the name can reflect the usage of the value

~~~
db48x
Sure, but then you still have to name the type.

~~~
sanjay_316
UnitInterval

Represent it internally as either fixed or floating point and divide to
convert in and out if needed.

With a nice type system you could even genericize the type over integer
constants

~~~
db48x
Others have already said it, but that name is for a type whose values are
intervals, not a type whose values are numbers within an interval.

------
_ZeD_
Better languages will let you call the variable just "accuracy", but with type
"float 0 to 1 inclusive" with some literal syntax; so from

    
    
        function FuncName(float AccuracySOMETHING)
    

to

    
    
        function FuncName([0...1] accuracy)

~~~
YawningAngel
Which languages allow this? It looks suspiciously like dependent typing to me

~~~
mrgriffin
FWIW, that's not dependent typing, because the type doesn't depend on run-time
values. A bool is either true or false, a [0...1] is either 0 or, ..., or 1.

As for which languages allow it. I'm not sure for floats, but Pascal let you
do it for ints for sure.
[https://wiki.freepascal.org/subrange_types](https://wiki.freepascal.org/subrange_types)

------
ivanhoe
Isn't that just the decimal part? In my mother tongue (Serbo-Croatian) it's
common to call this just the decimals - e.g. in 12.34 the decimals would be
34... I'm really surprised that English doesn't have a similar short name for
this?

~~~
0x76
Would that include 1 however? If you take the decimal part of something then
there is no difference between 0.00 and 1.00 which is I think part of the
problem here

------
eru
'Proper fraction' is very close in meaning.

[https://en.wikipedia.org/wiki/Fraction#Proper_and_improper_f...](https://en.wikipedia.org/wiki/Fraction#Proper_and_improper_fractions)

------
paozac
I think it depends on the audience. As a programmer I'd be happy with
zero_to_one, while a semitechnical audience might like better
normalized_ratio.

------
RedNifre
If your language supports it you could do

    
    
      function FuncName(Bound<float, 0, 1> Accuracy)
    

...or if it doesn't

    
    
      function FuncName(BoundFloat0_1 Accuracy)
    

...or if it's dynamically typed

    
    
      function FuncName(AccuracyBoundFloat0_1)
    

...or if mentioning the bounds explicitely is too verbose/YAGNI for your taste

    
    
      function FuncName(UnitIntervalFloat Accuracy)

------
pbhjpbhj
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].

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

------
negamax
Probability

~~~
delaaxe
This is the right answer for anyone in data science

------
BerislavLopac
Isn't that simply a decimal fraction?
[https://en.wikipedia.org/wiki/Fraction#Decimal_fractions_and...](https://en.wikipedia.org/wiki/Fraction#Decimal_fractions_and_percentages)

~~~
nicky0
Decimal fraction can be greater than one.

~~~
BerislavLopac
Proper decimal fraction?

~~~
nicky0
Exactly, in order to sufficiently specify the thing we are talking about we
seem to need at least three words.

------
eternalban
Fractional seems workable but it is exclusive. _fractional-unit-scalar_ seems
to work (domain, clarity) but it’s a mouthful:

 _Enter a fractional-unit-scalar value for the bias parameter_

 _Enter a fractional-unit-scalar value for probability p0_

------
sktguha
How about just oTo1InclusiveVal ? I know very simple, but would get the job
done ?

~~~
preommr
> substituting o for a '0'

pls no

~~~
sktguha
sorry must have typed by mistake in mobile

------
edejong
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)?

~~~
uniqueid
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 < 1\. My guess is that it's not that wasteful sticking with floats
or doubles.

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.

~~~
sgtnoodle
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.

------
tcbawo
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.

~~~
captainpicard
There was the "uno" proposal.

[https://en.wikipedia.org/wiki/Parts-
per_notation#Uno](https://en.wikipedia.org/wiki/Parts-per_notation#Uno)

I'm glad it never caught on.

~~~
tcbawo
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".

------
seanwilson
My arbitrary suggestion for what I sometimes use in coding is "stage". As in
"what stage has the animation reached?". At least it's short! Crops up a lot
in gaming and graphic code.

------
heftig
Since they didn't want to document, I think `float Accuracy0to1` is a nice
compromise that most people would understand instantly. Add `Incl` or `Excl`
if you really need to disambiguate that.

------
idefixy
extrapolating from "per-million" to "per-thousand" to "percent", how about
"perone" or "perunit". foo_perunit = foo_percent/100.

------
Konohamaru
I propose "tegritage", combining "(in)tegrity" with "-age". A concrete number
by analogy would be "0.753 tegrent".

------
IshKebab
I use fraction. Better than any of the answers there.

~~~
clktmr
Not true if the value refers to something like RGB color components.

------
zachrose
A unit value is a value in the unit interval.

------
asah
Given the lack of common language, IMHO describe it instead of being clever.

Example: FractionInclusive

------
mcculley
First, use a better language. This is the syntax as I remember it from Ada:

subtype Probability is Float range 0.0 .. 1.0;

------
zucker42
I use proportion in this context.

------
8bitsrule
"zeroToOne" includes both values. "Given a number from zerotoone..."

~~~
tobyhinloopen
zeroToOne doesn’t include one

------
treeman79
Perhaps a word that means “Almost Nothing”.

Piddling: amounting to very little; trifling; negligible

------
andromaton
We could call it a "Thiel", after his book "Zero to One".

------
__david__
Floating point boolean: It can convey True, False and all the grey in between.

~~~
klyrs
This is about as good as it gets for the concept, but lacks as a name. I
propose _boof_.

But actually there's two "natural" hardware implementations for this. First is
like floating point with no sign bits (mantissa is positive or zero, exponent
is negative). The other is fixed point, basically re-interpreting unsigned
ints as being implicitly divided by 0xfff...f -- both have advantages and
drawbacks. And then comes the operations. Multiplication is the only closed
operation -- addition, subtraction and division need special cases: should
they be clamped, or wrap around? Both, probably -- wrapping is useful for trig
functions, for example.

------
layoutIfNeeded
Since it's a value in the unit interval, I call it "unance".

------
eithed
Percentage.

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

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

~~~
eithed
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

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

~~~
Izkata
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.

~~~
Tainnor
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?

~~~
eithed
No, but you're defining a unit here; I'd expect people to put in values as
0..100 with unit being percent. So if a person puts in 20, and you'll want to
multiply it by 3, you'd not expect 60 as end result; you'd expect 60% which is
0.6

You're still raising valid point with the ambiguity - if I were to see a
variable named `population_percentage = 0.01` I'd still need to ask the author
if the intended value here is 1 or 0.01, which I'd say disqualifies this
naming.

------
codeulike
Closed, of course

Modoverflow strikes again

------
Causality1
I'd call it PropUnity, for proportion of unity, unity being 1.

------
laksdjfkasljdf
"Probability". This question would have a single word answer if it was posted
on math.stackexchange.com.

literally copy/pasted from wikipedia:

> A probability is a way of assigning every event a value between zero and
> one,

~~~
fireflies_
A probability has to lie between 0 and 1 but not every value between 0 and 1
is a probability.

~~~
laksdjfkasljdf
the probability of a "value between 0 and 1" to be an actual probability is
very close to 1.

------
wruza
The real answer to this XY is comments and documentation, imo. If you want to
make it obvious without reading docs or code, get an IDE with doxygen-aware
completion.

Edit: also, put it into typename, not into argname.

~~~
wruza
From a practical point of view, a new/academic word would still require serp
lookup in most cases. If it were in a type, like float01, one could easily
jump to the function definition and then to the type definition, described by
a comment. In the case of argument naming, there is no place to jump to, only
googling remains.

------
lhnz
How about we coin it now? We could call it a Thiel.

------
visika
Looks like it could be a "probability".

------
neskiredk
function FuncName(float ShouldBeAccurate)

function FuncName(float AccuracyBoolean)

function FuncName(float BoolAccuracy)

function FuncName(float IsAccurate)

------
mafia303
Onecentage

------
mongol
Factor

------
aappleby
Perunit

------
arbirk
it's called a share

------
gct
perunum

------
spicybright
I'd personally go with "percent", but because there's so many correct options,
it shouldn't matter as long as it's consistent in the code base. Otherwise it
just becomes bike-shedding bait.

~~~
peteretep
Right but it’s specifically not, and liable to make people think “3” is an
acceptable input

~~~
spicybright
Again, this is bike shedding bait. I'm going by my own experience with basic
mathematics in my American education where "percent" is something you multiply
a number by, and usually ranges from 0 to 1.

Ex. 50% of 12 marbles is 6 (*.5, 50%).

But just looking at all the different answers in the comments here means
there's no consensus on a "right" way. Hence bike shedding. A decent code base
should be consistent so it can focus on more important things.

~~~
fnord123
There might be bike shedding for the best answer, but this is just incorrect.
Percent literally means "for one hundred"

------
preommr
Why is everybody else suggesting things like 'accuracy', and 'between_0_1"
when there exists an actual term: "unit interval" (the top answer)

[https://en.wikipedia.org/wiki/Unit_interval#:~:text=In%20mat...](https://en.wikipedia.org/wiki/Unit_interval#:~:text=In%20mathematics%2C%20the%20unit%20interval,I%20\(capital%20letter%20I\))

If you google accuracy, you'll get the noun. If you use a made up term, it'll
probably return useless results.

~~~
nicky0
Unit interval is the _interval_ between 0 and 1. We need a word for a value
within that interval.

~~~
preommr
Then "unitIntervalValue"

~~~
nicky0
Right. That's the thing we need a word for :)

Unit Interval Value is nice but still a bit cumbersome. I mean if we all
agreed right now it were called a "poog" then we could just say poog.

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

~~~
kelnos
Exactly. The best usage for this would be something like:

    
    
        typedef float UnitInterval;
    
        void do_something_accurately(UnitInterval accuracy);

~~~
throwaway287391
It's still not really "correct" IMO, I think it needs to be
"UnitIntervalValue" as someone said above. I'd expect that things of type
"UnitInterval" would be intervals, not values. "UnitInterval" would be like
calling the type "Int32Range" instead of "Int32".

(NB: "In real life" I would never "correct" someone for calling it
"UnitInterval", it's good enough -- but given this is a pure discussion of
semantics...)

~~~
kelnos
Sure, that's fair. I was more talking about it being better to name the _type_
a particular thing, rather than encoding the type in the variable name.

