100

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?

user81993
  • 1,145
  • 8
    probabilities meet this criterion, but I guess not all things that meet this criterion are probabilities... – herisson Sep 24 '15 at 00:34
  • 1
    Also, do you mind if I critique the premise? why do you need to put this information in the parameter name? Won't it be obvious from the way the program is set up? And if not, can't it just give an error message if an out-of-bounds value is somehow put in? – herisson Sep 24 '15 at 00:38
  • I'm so sick of writing documentation for things that should be explainable in a word. Words don't exist until they are defined somehow. Are you defining your terminology? – Hot Licks Sep 24 '15 at 00:39
  • 5
    What's wrong with, e.g. function FuncName(float RealNum0to1) or something like that? It can't be looked up in a dictionary but then neither can 'MaxSizeN' – chasly - supports Monica Sep 24 '15 at 00:41
  • 3
    It's not a single word, but try "proper fraction" If you were concerned that the values weren't fraction, you could try "proper decimal". – DJClayworth Sep 24 '15 at 00:43
  • @sumelic not always, if you're writing a general purpose library then a lot of function overloads are common and in most languages that means they are only separated by parameter names – user81993 Sep 24 '15 at 00:47
  • @chaslyfromUK Well, it would have to be "AccuracyRealNum0to1" that would indeed fulfill my requirement but I was hoping for an actual word rather than abbreviation of 5 – user81993 Sep 24 '15 at 00:51
  • @DJClayworth the type float is synonymous with fraction in itself so maybe I'll just start adding the word "Proper" to things like (float ProperAccuracy), looks neat! Also the word proper has no other meaning I've heard of in programming context so thats good too. – user81993 Sep 24 '15 at 00:55
  • 9
    The formal mathematical term for this is the [closed] unit interval. But I too have wished for a more common/accessible word for such an ubiquitous concept (how often do you mention or think in terms of percentages? Well, that's just the unit interval * 100 (capped at 100%, of course)). – Dan Bron Sep 24 '15 at 01:04
  • 1
    The term "factor" (meaning "multiplier") is often used for a value in the unit interval. That meaning (in the unit interval) is not implicit, but it can be stated once and should "stick" pretty well. – Hot Licks Sep 24 '15 at 01:37
  • Proportion might work. Since it's not public you could just make up an analogue to percent like perunit. – Neil W Sep 24 '15 at 02:11
  • @user81993 there's always float negExp. In scientific notation, you're talking about numbers with negative exponents. – stevesliva Sep 24 '15 at 04:09
  • In fuzzy logic, we use "degree" or "degree of truth" (https://en.wikipedia.org/wiki/Degree_of_truth) for a number from the real unit interval that expresses the level at which an objects attains a given property (such as accuracy). But I understand that "accuracy degree" already has an established meaning, pertaining to decimal precision. – anemone Sep 24 '15 at 06:56
  • @user81993 - You say, "I was hoping for an actual word rather than abbreviation of 5". That's your problem right there. Can you give us any dictionary word in the English language that covers the meaning of 5 other words? It is an unrealistic request. – chasly - supports Monica Sep 24 '15 at 08:46
  • 1
    Why not define a new type alias called "PercentFloat" (aliasing it to float) and then write validation functions to ensure that values of that type do indeed fall between 0 and 1? You will then add this type and its validation functions to a module of its own with the necessary documentation string. Wherever this type alias is used, readers can lookup its origin to understand the meaning. – Sridhar Ratnakumar Sep 26 '15 at 05:44
  • 4
    I tend to use either "Fraction" or "Proportion" for this. The words don't in themselves indicate that the number has to be on the unit interval, but then neither does the word "Percentage" indicate that a a parameter has to be in the interval (0,100). One needs to distinguish between how such a parameter is used and what its bounds are (the latter often being determined by the former). From a coding perspective, it is usually more important that a parameter name reflects its functionality than its bounds. – Rupe Nov 11 '15 at 13:12
  • 1
    In my code that deals with such numbers I use names like 'normalizedAccuracy'. It is not exactly cilorrect from a math POV but my colleagues like/understand it. – Andreas Wallner Nov 11 '15 at 21:59
  • See also: http://english.stackexchange.com/questions/218655/a-number-between-0-and-1-like-a-percentage-but-expressed-as-a-decimal. In particular, I like this answer: http://english.stackexchange.com/a/218757/6006 – MrHen Dec 07 '15 at 17:58
  • If I absolutely have to, I will call it accuracyFraction or anything with word fraction. A programmer will know he can use 0 or 1 with that. -ve fractions will still be issue. Though you will need to put in boundary checks inside the function and throw/show descriptive errors anyway. – R.S. Dec 29 '15 at 12:35
  • Looks like it's time to create a new word! – Nick Mar 31 '16 at 04:34
  • It is called in mathematics unit interval (see http://math.stackexchange.com/questions/2489/is-there-a-name-for-0-1 or https://en.wikipedia.org/wiki/Unit_interval) – Tim Sep 22 '16 at 10:12
  • 0 to 1 implies 0.1, 0.2, 0.3...0.9 or something like 0.01, 0.02, 0.03...0.14...0.67, 0.68...0.99 or something with more digits after the decimal point? – SovereignSun Nov 02 '16 at 10:44
  • In a typical mathematics paper, we could use [0,1]-valued, as in the function is [0,1]-valued (typographed via $ signs around [0,1], to indicate mathmode in TeX). – David Handelman Nov 02 '16 at 20:21
  • And all the other answers are terrible! – David Handelman Nov 02 '16 at 20:24
  • @HotLicks "Words don't exist until they are defined somehow." That's not how language works. – Mitch Nov 02 '16 at 22:07
  • @Mitch - That's exactly how it works. Of course the "definition" does not need to be formal and written, but can come through use. But a word doesn't exist just because I say "kerijmy" -- the pattern has to be repeated often enough to become associated with a meaning. – Hot Licks Nov 02 '16 at 22:10
  • @HotLicks a definition is presumably in words itself. it's the real world context that gives it meaning, and a lexicographer comes afterward and cleans things up by writing down a sentence definition. Isn't that perfectly cromulent? – Mitch Nov 02 '16 at 22:12
  • @Mitch - Definition is in use. The "word" doesn't exist until it's used with a (perhaps unspoken) agreement as to its meaning. – Hot Licks Nov 02 '16 at 22:14
  • @HotLicks is a definition in words or use? Usage comes first then follows an attempt at articulating a worded definition. – Mitch Nov 03 '16 at 00:19
  • @Mitch - You're saying a word isn't defined unless it's written in a dictionary?? – Hot Licks Nov 03 '16 at 00:36
  • @HotLicks No. That's what I understood you to say. So we're using the same words but different nuances. – Mitch Nov 03 '16 at 01:06
  • Naming variables is expressly off-topic here. This question, and the answers to it, are the perfect showcase of why. – RegDwigнt Nov 04 '16 at 11:58
  • Part of the problem, as you say, is that a float can be practically any value. Personally, I'd typedef "float" to something else, so that the function signature was something more like FuncName(Accuracy a). – calum_b Aug 16 '18 at 11:07
  • I find none of the answers satisfactory or likely to be clear to a developer coming across the code fresh. I would choose instead not to try to squeeze this fact into the parameter name. I'd call it Accuracy and add an assertion prominently in the first line of the function. (In addition to a parameter comment on the method.) – Joshua Goldberg Sep 03 '20 at 22:12
  • if people are putting invalid values in... make some asserts that validate it, make some type that encapsulates the range, or makes it safe with clamping... there 101 things beyond naming that will help here. – jheriko Sep 04 '20 at 13:17
  • Super question and one which just popped into my head when reviewing a description of a 0-1 inclusive range for a float. I've gone with the "unit interval" terminology which I had never heard of before! – w5m Jul 09 '21 at 14:01
  • This question keeps popping up, and my conclusion is that there just isn't a good and well-established English name for these numbers. So for my own coding, I'm making up my own word: unidecimal. – Kal Mar 10 '22 at 22:55

14 Answers14

52

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.

  • 3
    I wouldn't abbreviate "interval" to "int". That name is already taken in a programing context. def UnitInt: return 1. As the trend these days seems to be for longer function names, just go for UnitInterval. – Chris H Nov 03 '16 at 19:26
  • 1
    @Richard Kayser Here I was enjoying your suggestion: UnitInt And then it hit me... I can just see myself trying to differentiate Unitint from that zoo of integer types in glib with sleepy eyes! – Terry Wendt Nov 03 '16 at 19:34
  • @Richard Kayser unsigned int, int, gint, guint, gintptr, guintptr, gint8, guint8, gint16, guint16, gint32, guint32, gint64, guint64, UnitInt... – Terry Wendt Nov 03 '16 at 19:44
  • @ChrisH I agree. I didn't put a lot of thought into it, as it's a programming choice. I'm going to edit my answer to reflect your comment. Thanks. – Richard Kayser Nov 03 '16 at 20:39
  • @TerryWendt Wow. I didn't realize there was such a zoo of integer types. UnitInterval (see response to Chris H's comment) should be easier to pick out than UnitInt, even with sleepy eyes. Thanks. – Richard Kayser Nov 03 '16 at 20:51
  • 24
    But UnitInterval is a name for an interval, not for a number in it. – Alec Mev Jun 10 '18 at 17:19
  • 1
    And you might consider making "UnitInterval" a typedef, rather than the parameter name -- i.e. function FuncName(UnitInterval interval). – calum_b Aug 16 '18 at 11:09
  • The definition of "unit interval" exactly matches my requirement, so I'll be using this to describe a data type which is a 0-1 inclusive range of floating point numbers. I'd never heard the term before, so many thanks for educating me! – w5m Jul 09 '21 at 14:03
  • Very late to the party but just wanted to mention the abbreviation UnitInt does make sense if you consider the most efficient storage for the type would be as the reciprocal of the number i.e function FuncName(int UnitInt) ... inside the function would be evaluated under the assumption (UnitInt/MaxInt) == UnitInterval – user263399 Mar 24 '23 at 17:09
39

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

  • 1
    Mantissa in this meaning would be correct, but it does not meet OP's criteria for inclusiveness of 0 and 1. – macraf Nov 11 '15 at 21:31
  • 1
    Indeed. A friend with huge vocabulary suggested primantissa, as he believed the word did not exist, and called for a neologism. – Laurent Duval Nov 11 '15 at 21:38
  • 2
    A think proportion is the correct term here. – dwjohnston Apr 17 '16 at 22:59
  • 1
    this is what i've used over the years without giving it great thought, although in many cases 'probability' will do better – jheriko Sep 04 '20 at 13:16
  • 1
    Primantissa is a beautiful neologism, but just too long. I propose "pun", "proportion of unity" abbreviated, or "proportion of unity, normalised" as an acronym, or "per un" contracted. It's clearly not conflicting with the common meaning (word play using similarity of sound). "Pot" to me sounds like it could be a reading of a potentiometer or equivalent software widget. – pbhj Sep 04 '20 at 14:39
  • The term pun is nice, let us be pro-fun! With the first two letters of proportion of unity – Laurent Duval Sep 04 '20 at 14:48
  • The problem with "probability" is that it implies semantics. In this case I'm trying to find the amount of the whole that is affected by something. I guess that is kind of like the probability that any particular item was affected but there is no randomness in what I am asking. – Kevin Cox Sep 04 '20 at 14:57
  • 1
    'Primantissa' is not a neologism, beautiful or otherwise. It's D-I-Y and not in the lexicon; neologisms are words newly accepted into the lexicon. – Edwin Ashworth Sep 04 '20 at 15:08
  • 2
    At least in French, I believe that néologisme is accepted as a word formed from existing elements of a language, even if not in a lexicon. Reading again, I called it a novel word, and my friend "called for a neologism" (none seems accepted for now) – Laurent Duval Sep 04 '20 at 15:16
  • 1
    If bootstrapping a neologism, but 'primantissa' too many syllables or too-obscure in origins, contracting 'unit interval' to 'unival', or '[unit] proportion' to 'uniprop', could have potential. Two syllables, and the 'uni-' is evocative of the range – as some would consider '2:1' a 'proportion', but it seems desired that any term here exclude that. (As an aside: in English as this native speaker understands it, a 'neologism' exists upon coining, not anyone else's acceptance. Why, ofthapps I've wordstrapped duotrip frowndoomed neologisms erely mornimeal!) – gojomo Sep 04 '20 at 17:27
  • Latin roots are learnt here, so they are not "too obscure" for some of us. Plus, words like mantissa are not unknown in my field, between electrical and computer engineering" or "computer science" – Laurent Duval Sep 04 '20 at 22:11
  • 2
    I love primantissa. primant for short. This concept absolutely needs a word and I've already started using it in my code. I'm making it a thing. – DeusXMachina Sep 30 '20 at 03:41
  • Primant is a great shortening – Laurent Duval Sep 30 '20 at 09:15
29

In the 3D graphics programming world, values such as color components that are scaled to the range [0, 1] are referred to as normalized.

So you can use:

function FuncName(float AccuracyNormalized)

when you're expecting an argument in the range [0.0, 1.0].

Gnawme
  • 40,887
9

Edit: I came back to this and lamented my original answer's failure to win people over. I thought it was a good answer. Then I set about thinking of more ideas. Coming up with one, I went to add an alternate answer, only to realize the question had been closed. I'll note it here, as it may be better than my original answer (below the cut) and perhaps it will be useful to someone who comes along in the future. If not, oh well.

portion

noun

  1. A part of any whole

I think this is exactly what we're trying to describe. It's somewhere between none and all of a whole, inclusive. A portion is never more than all of the whole, and it's never less than none, so that fits with the "unit interval" theme, without being quite so awkward as literally saying "unit interval".


Original answer:

It's not quite the specific word you're looking for, but if you want a word that a reader will intuit the way you want, you could reference a physical input like a dial or a slider. The mental image of a physical device may provide the caller with a much clearer idea of the parameter's usage.

That being said, words like "dial" and "slider" feel inelegant and might imply too great an association with UI elements/objects, rather than values.

In engineering terms, those inputs are potentiometers. I don't think you'd want to use such a long word as "potentiometer", but they do have a nice abbreviation for that class of inputs:

Pot

For example:

VolumePot
AccuracyPot
ContrastPot

It's a sufficiently distinctive and specific word that it would be unlikely to be mis-intuited. Either a person would know what it was and what it implied, or they would be forced to ask about it and learn the implications.

I've actually seen this used in the past, by the way. I'd forgotten about it until just now. I recall thinking it was quirky, but I did understand the meaning.

  • Sigh. I'm sad that this did not appeal to anyone, and even encouraged someone to downvote it. "Pot" is such a simple, unique, concise, un-confusable term that it would do well for this purpose if it were popularized. The other options are all so wordy or inelegant (e.g., while accurate, the top answer of "UnitInterval" is anything but convenient). Oh, well. – Aiken Drum Jan 03 '18 at 07:07
  • "mis-intuited" is a word? Is that supposed to be a pun? I think writing un-confusable with a hyphen is un-conventional :) To a layperson such as myself, your suggestion "pot" does not suggest that it is an abbreviation, but rather a vessel for plants or for cooking. Or even a soft drug. You probably got the anonymous downvote for that reason. I'm sure the downvoter, who was probably a computer software engineer who posts on StackOverflow, believed the suggestion was inappropriate. – Mari-Lou A Jan 03 '18 at 08:57
  • Citations and references should always be clearly attributed by the way. – Mari-Lou A Jan 03 '18 at 09:00
  • @Mari-LouA - Really? I criticize a question you post, and you start stalking my comments? That's not creepy at all. – Aiken Drum Jan 04 '18 at 23:08
  • 1
    what's the difference between portion and proportion? – Adrian Mar 07 '19 at 22:37
  • @Adrian A proportion expresses a ratio, how much of one in relation to how much of another (to how much of another, etc.), usually to complete the whole, e.g. 1 packet of kool-aid powder to 1 cup of sugar to 2 quarts of water to make a pitcher of kool-aid. A portion is how much but implicitly relative to the whole, e.g. "I drank half (0.5, 50%, however you want to say it) of the pitcher of kool-aid all by myself!" Side note: my dentist disapproves of this example. – Aiken Drum May 22 '19 at 04:59
  • @Aiken Drum, I think you're wrong: "proportion" is what the questioner is asking for here, it is 'the fraction of the whole if the whole is normalised to unity'. Portion, can be > 1. If I eat a portion of sweets that could be 12; the proportion would be 12 out of 20 (0.6). Yes, a portion of cake is usually a fraction of 1, but a portion of biscuits might be 5; then you can ask what proportion that is of all the biscuits, if it's 0.2 (often that would be given as a percentage) then there were 25 biscuits. – pbhj Sep 04 '20 at 14:26
  • @pbhj What is the source for the definition you placed in quotes there? I searched and found no match. When I wrote my response to Adrian, I took care to research and to be sure of the definitions of the words, and how I described them was accurate to that research. Your example of 5 biscuits as a portion is a colloquial misuse of the proper term, derived from people portioning a meal out to the diners, e.g. given a packet of 15 biscuits, each of three people might receive an equal portion of 5 biscuits, but that "portion" is actually ⅓, rather than 5, being their share of the original amount. – Aiken Drum Sep 18 '20 at 00:14
6

A unit ratio is a fraction with a denominator of 1. Not perfect, but it's what I use.

unit ratio

Alternatively, if we're looking for absolute precision:

unit interval ratio

3

My suggestion would be "fractional". While not perfect you didn't sound like you were going for perfection. It hints at the need for the float to be a fraction (a value between 0 and 1). The downside is it seems to exclude 0 and 1 but you can use your definitions to clear that up I'd imagine.

Cormac
  • 41
  • 2
2

In your context how about PerUnit. The phrase "per unit x" is commonplace which gives a helpful layer of familiarity, though it's easily understood from the individual words. In "electrical engineering, a per-unit system is the expression of system quantities as fractions of a defined base unit quantity" (Wikipedia). While this may be a completely unrelated field to yours it has that fraction of something quality you're looking for.

Chris H
  • 21,709
  • 1
    This is an already established term for this, as documented in Wikipedia. It also relates to the author's comment regarding the use of 'accuracyPercent' as a possible name for the variable. – Pablo Straub Feb 23 '16 at 13:13
  • This is a pretty good answer, as it's the 0-1 equivalent of 0-100%. However, I work in the electrical engineering industry and I regularly encounter per unit values greater than 1 (in the same way that someone might encounter a percentage value greater than 100%), so I don't think you can always infer a maximum of 1 when using the term "per unit". – w5m Jul 09 '21 at 13:58
  • @w5m similarly in physics, but you can have >100% just as easily (e.g. gain when you want a linear or layperson's scale) – Chris H Jul 09 '21 at 14:12
2

In common English, I'd probably use decimal. I could imagine that could be confusing if you're using binary, octal, or hexadecimal numbers, though.

Jacktose
  • 445
0

I used to have this same problem. I standardized on using "scalar". It's not perfect, but once I have explained it in one place in the code, its meaning is obvious elsewhere. One problem with this word is that by itself it doesn't imply the range 0 to 1, but I use it consistently to be 0 to 1 and never anything else so it works pretty well. I, too, would like a single (and preferably short) word that more accurately describes this range, but this works for me.

Kent
  • 145
  • 4
0

0 to 1 implies only 0.1, 0.2..0.9? or also 0.01, 0.02..0.99?

In any case I myself am a programmer and an SQL database administrator and I prefer to use the term "a scale of a number" which means "the number of digits to the right of the decimal point in a number."

In the first case you a have a scale of 1 whereas in the second case you have a scale of 2.

A "scale" is - a succession or progression of steps or degrees; graduated series; a sequence of marks either at regular intervals or else representing equal steps, used as a reference in making measurements;

https://msdn.microsoft.com/en-us/library/ms190476.aspx

In this case you get a range from 0 to 1 with a scale of [scale] (a step of [scale]).

It is easier to say Scale 0 to 1 (Scale -1 to 1 if with negative) if you want to imply tenth, hundredth, thousandths and e.t.c withing a range between 0 and 1 including 0 and 1.

-1

I refer to numbers like that as "homogeneous components," but I work in games, and our terms are in the idiom of a very small circle.

KECG
  • 21
-1

Range0-1 would work as part of a parameter name, particularly as you are going to define the term anyway. If you are going to use it as a prefix or suffix you could even shorten it to rng0-1

As an alternative you could use domain0-1 or dom0-1 as the domain of a mathematical function is the range of input values over which it is defined.

BoldBen
  • 17,171
-2

I've just finished a year long programming project for university with this everywhere.

I went with:

percentNormalized

p.s. I like long descriptive variable names and methods, sometimes they can even lead to very nice self-commenting code.

(sometimes they can lead to lines being way to long though... espcially in conditionals)

  • 3
    Naming of variables is off-topic, but this answer can be rescued by explaining normalised. So far, nothing in this answer explains why normalised works; your educational history and likes and dislikes are not really relevant, I'm afraid. – Andrew Leach Sep 27 '15 at 11:57
  • 2
    Well, you can vote/suggest/flag or do whatever you feel 'afraid' to do. But I personally think that user81993 will understand my answer with no further explanation, they may even appreciate the context. – Lamar Latrell Sep 27 '15 at 12:20
  • To me, this is like giving the number 1 the name "half of two". A percentage is simply a fraction multiplied by 100. If one wants a word for a percentage divided by 100 then the word "fraction" serves perfectly. – Rupe Nov 11 '15 at 13:19
  • 'Fraction' was the word that came to my mind as soon as I read the original question. The issue is that fractions can be bigger than one and can also be negative. Of course, that also happens to percentages. – Pablo Straub Feb 24 '16 at 03:16
  • 2
    I just ran into OP's situation yesterday and without thinking about it too much, I used "Normalized" (e.g. costNormalized, chanceNormalized). "Normalized" per se is too general a term, but when numbers are normalized in practice, it's usually to a 0-1 scale. I don't know if that'll meet ANSI standards or anything, but it was clear enough for my script. – Jacktose Sep 09 '16 at 14:02
-3

There is a word that describes the values between and inclusive of 0 and 1 in my vocabulary, but there is evidence that its meaning varies depending on which part of the world you were educated in. So even though we are speaking of math, the answer to a linguistic question is subjective:

The word I would immediately assign to a function you defined is gradient in the meaning of a linear representation of a rate of change of a function, thus possible to express as a value from 0 to 1.

Equivalent to what Wikipedia defines as a Grade (slope). Gradient is listed as one of the alternative words and is explicitly differentiated as a subset of a more broad gradient in calculus. Unlike other synonyms, ie. slope, incline, pitch or rise, it does not have strong relation to a notion of a physical slope.

macraf
  • 2,740
  • A gradient goes from 0 to 1 if you are going up (it would be negative if going down) and the slope is less that 45 degrees. This is evident in the same reference given in Wikipedia given. 'Gradient' is not a good term for a number from 0 to 1. – Pablo Straub Feb 23 '16 at 13:09
  • @PabloStraub Frankly, I don't understand what you are trying to say. – macraf Feb 23 '16 at 13:14
  • 2
    In mathematics, 'gradient' is the slope of a curve or surface. A gradient of zero means flat; a positive gradient means a slope upwards; a negative gradient means a slope downwards. A very steep slope can have a gradient arbitrarily large. A 45 degree slope will have a gradient of exactly 1. As it gets steeper the gradient grows more to the point that a vertical would have an infinite gradient. So at least in a mathematical context, 'gradient' has nothing to do with a number between 0 and 1. – Pablo Straub Feb 24 '16 at 03:22
  • You are referring to this meaning of slope, I referred to another one which I referenced and explained. What's the point? – macraf Feb 24 '16 at 03:30
  • 2
    Yet in none of these meanings of slope the gradient in never constrained to be between 0 and 1. – Pablo Straub Feb 24 '16 at 03:53
  • And naming the variable "gradient" would break the code? – macraf Feb 24 '16 at 04:37
  • A gradient is something very different http://www.merriam-webster.com/dictionary/gradient and http://www.thefreedictionary.com/gradient. You could philosophically agree to that it might be used thus way but it's obviously something to do with visualization. – SovereignSun Nov 02 '16 at 10:55
  • I referenced the source I was using. I think I was also clear of knowing the word has different meanings. Nevertheless thank you for providing the most commonly referenced dictionaries on the internet. – macraf Nov 02 '16 at 11:01
  • @SovereignSun And by the way, the M-W you linked to says "gradient - a graded change in the magnitude of some physical quantity or dimension". Now read the question and tell me how does it contradict OP's intended usage. – macraf Nov 02 '16 at 14:03
  • @macraf As I said "gradient" has more to do with visualization rather than mathematics although such a term does exists in mathematics and has a different meaning. – SovereignSun Nov 02 '16 at 14:15
  • @SovereignSun Yes. And in the phrase "gradient in calculus" the word "calculus" is a synonym of your "visualisation". Now, that's philosophical thinking. – macraf Nov 02 '16 at 14:16