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

I'm a programmer. I'm so sick of writing documentation for things that should be explainable in a word.

When you write a function in a programming language, you get to name its parameters. 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.

Very often though, there is a parameter that is a floating point type (float) that needs an input in the range of 0 to 1 (inclusive). This is problematic since I have no idea what to call those things so I have to write function descriptors (assuming the language has them) or document it some other way which is annoying.

Lets say this float needs to define the accuracy of something so I declare it:

function FuncName(float Accuracy)

This is very ambiguous since the type float itself can contain a ridiculously large variety of numbers. Meanwhile if I were to declare it as such:

function FuncName(float AccuracyPercent)

Then its immediately obvious that the input should be a value from 0 to 100.

Percentages aren't useful for math however, they are more like a "human friendly" markup for fractions and have no place in actual program logic and I'd rather avoid unnecessary overhead.

I'm looking for a word that I could mangle into my parameter names so that they would convey "this should be from 0 to 1".

I don't even care if the word is unknown to most people, I'll just start using it and tell others to read the dictionary :D

Is there any word for that?


Solution 1:

How about unit interval?

From Wikipedia:

In mathematics, the unit interval is the closed interval [0,1], that is, the set of all real numbers that are greater than or equal to 0 and less than or equal to 1. It is often denoted I (capital letter I). In addition to its role in real analysis, the unit interval is used to study homotopy theory in the field of topology.

In the literature, the term "unit interval" is sometimes applied to the other shapes that an interval from 0 to 1 could take: (0,1], [0,1), and (0,1). However, the notation I is most commonly reserved for the closed interval [0,1].

The word you're seeking may be UnitInterval:

function FuncName(float UnitInterval)

Note for other users: Many numbers in the unit interval are not fractions, i.e., rational numbers. They may be irrational numbers, e.g., pi/4 and the square root of 1/2, neither of which can be expressed as a ratio of two integers. At the same time, all numbers with a finite number of digits are rational numbers.

Acknowledgement: I changed my original UnitInt to UnitInterval based @ChrisH's comment. Thanks, Chris.

Solution 2:

Proportion or primantissa, from generic to novel words. [I appreciate the primant shortening proposed by DeusXMachina]

"Proportion" is my first generic choice, especially in its "percent" acception (acceptation). Apparently, before the decimal system, fractions in the form of 1/100 were common. The "%" sign evolved from Italian "per cento", cento being contracted into two circles separated by a bar.

From chemistry, I would like to rejuvenate the term "stoichiometry" (from Greek words στοιχεῖον, stoicheion "element" and μέτρον, metron "measure"). From order statistics, with a twisted use, "fractile" could be easy to understand (usual derivatives are percentile, centile, quartile, quantile).

From computer-based representations, the term "mantissa" could be fine, alas its use is discouraged by many authorities (IEEE floating-point standard, D. Knuth). Mantissa is an interesting term (but the origin might seem obscure): it may denote: surplus, remainder, overdose, leftover. It was used to denote the fractional part of a base-10 logarithm: for 123.45, Log(123.45) = 2.09149109..., so the (integer) characteric is 2, and the (remainder) mantissa est 09149109... One may could be "significand", the significant digits of a number in scientific notation or a floating-point number.

Finally, I asked a friend with a huge knowledge in scientific terminology (author for instance of Le manuel du système international d'unités : lexique et conversions, in French only). He claims that one should invent new names for such concepts, and proposed a nice "primantissa" (or "primantisse in French).