Name for percentage as a decimal between 0 and 1 inclusive

4.1k Views Asked by At

Problem

I'm unsure if I should be asking this here or on English Language, so sorry if it's not a good fit for a site.

I'm looking for a term that describes a number between 0 and 1, inclusive, that represents a percentage. For example, 0.5 would be 50%. I've considered decimal and floating point, but this doesn't convey the fact that such values should only be between 0 and 1 (as values outside this range can also be considered decimals and floating point numbers).

Context

In a programming library, there is a colour type. This type has a member function provides it's RGBA values in different formats, such as the one above. The term I am looking for would fit the following sentence:

Get the colour as a <insert term here>

2

There are 2 best solutions below

0
On BEST ANSWER

So as to clear this off the unanswered queue (from comments):

A "portion of 1", or a "decimal portion of 1" seems to be agreeable.

0
On

Probably not what you want for naming variables, but it's traditional name is decimal fraction.

Unfortunate that it won't reduce down to a single word. Since it's (usually) a number that's less than 1, we could use the term mantissa but then (I'd strongly argue) we're not only highly inaccurate, we're being needlessly obscure, possibly even pretentious. We'll wince at our code every time after, or worse, we'll believe our own pretentions. No, and bear with me here, naming things in fancy ways that show off we did math undergrad isn't cool or useful. We should name things in clear, unobscured, unobfuscated ways. Wherever possible (hint: it's always possible.)

While this is now 8~ years ago, and the use case has long since passed..

...Simply calling the thing percent is 100% fine. Why? Most programmers worth a buck, when thinking of percentages. Thinks of 0...1, it's the last step of the mental calculation between n% and the result.

tl;dr use percent because that's what the value is, but the form of expression is decimal fraction.