16 ms·
A word for a value between 0 and 1 (inclusive)
- Someone 6y ago“mantissa” (https://en.wikipedia.org/wiki/Common_logarithm#Mantissa_and_characteristic https://en.wikipedia.org/wiki/Common_logarithm#Mantissa_and_...) 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.
- cwmoore 6y agoOff-topic, but the wonderfully specific word "mantissa" comes up so infrequently that I just have to share this painting [0] of mine that features it. [0] https://www.curtiswmoore.com/image_detail.php?title=manta.jpg https://www.curtiswmoore.com/image_detail.php?title=manta.jp...
- ramshorns 6y agoSo the word mantissa has two different meanings that show up in really similar contexts. In log(120) = log(1.2 × 10²) = 2.079, you could call both the .079 and the 1.2 a mantissa. The first is in the range [0,1) and the second, aka significand, is in [1,10) for base 10. And really one mantissa is just the log of the other.
- freyr 6y agoCan we just represent 1 here as 0.999...?
- prox 6y agoThere is an answer by someone who suggested a neologism, check the link for source.
- rocqua 6y agoThing is, whilst a mantissa is indeed between 0 and 1, not every number between 0 and 1 is a mantissa. Specifically, a mantissa suggests the existence of a significant.
- parliament32 6y agoI'd agree with "portion" or "part" -- describes a percentage in decimal notation, to me at least.
- deleted 6y ago[deleted]
- sktguha 6y agoHow about just oTo1InclusiveVal ? I know very simple, but would get the job done ?
- bridgeland 6y agoGiven 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.
- deleted 6y ago[deleted]
- FabHK 6y agoNaming the variable "accuracyPrimantissa" doesn't seem delightful to me, though.
- donw 6y agoI 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 6y agoYou're not wrong but it would be nice to have a word for this incredibly common type of value still.
- donw 6y agoAs a mathematician, I heartily agree.
- V-2 6y agoI couldn't agree more. If you can't express it using the features of the language itself (custom domain-specific type, compile contracts?), limit yourself to putting this info into the docs, but keep naming simple. Don't come up with fancy names. One of the commenters already declared (jokingly??) they'd "call it PropUnity, for proportion of unity, unity being 1". Holy smokes Batman. As a code maintainer, I imagine encountering "accuracy" (even though it isn't fully accurately named itself) would confuse me somewhat less than "propUnity".
- deleted 6y ago[deleted]
- pftburger 6y agoWouldn’t this be a normalized / unitized float? Or at very least an absolute normalized float
- spicybright 6y agoI'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 6y agoRight but it’s specifically not, and liable to make people think “3” is an acceptable input
- spicybright 6y agoAgain, 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.
- v21 6y agofwiw, this post was inspired by a twitter thread i created yesterday (https://twitter.com/v21/status/1301451641699340288 https://twitter.com/v21/status/1301451641699340288), where i collected examples of people getting annoyed that this term doesn't exist... and most of those were inspired by frustration at this being called a percentage when it wasn't. so if you want a nice collection of people stubbing their toe on the word percentage, it's out there.
- fnord123 6y agoThere might be bike shedding for the best answer, but this is just incorrect. Percent literally means "for one hundred"
- deleted 6y ago[deleted]
- wruza 6y agoThe 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 6y agoFrom 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.
- 0xBA5ED 6y ago"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.
- sgtnoodle 6y agoI 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 6y agoI’ve also seen “fraction” used for this concept in Apple/NeXT APIs. E.g., “-[NSImage drawInRect:fromRect:operation:fraction:]” and “-[UIViewPropertyAnimator fractionComplete]”.
- aappleby 6y agoPerunit
- _ZeD_ 6y agoBetter 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 6y agoWhich languages allow this? It looks suspiciously like dependent typing to me
- mrgriffin 6y agoFWIW, 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
- Causality1 6y agoI'd call it PropUnity, for proportion of unity, unity being 1.
- smitty1e 6y ago"Normalized". That's what we call data that have been scaled to fit on a tidy axis.
- AstralStorm 6y agoThis has a nice confusion factor because IEEE calls such floats denormalized. Because they may have extra precision and different format.
- MaxBarraclough 6y agoPerhaps I'm misunderstanding you, but with floating point, denormalized/denormal numbers aren't just numbers with a magnitude less than 1, they're numbers so small that it's no longer possible to adjust the exponent in the usual way, so leading zeroes are used in the mantissa. This reduces precision. https://en.wikipedia.org/wiki/IEEE_754-1985#Examples https://en.wikipedia.org/wiki/IEEE_754-1985#Examples https://wiki.sei.cmu.edu/confluence/display/c/FLP05-C.+Do+not+use+denormalized+numbers https://wiki.sei.cmu.edu/confluence/display/c/FLP05-C.+Do+no...
- 0b01 6y agoNormalized could also imply demeaned.
- joshvm 6y agoYou could also call that centred to clear up confusion, or mean-subtracted to be more specific. I think if you're specifically dealing with statistical quantities it should be obvious, e.g. standardised if you also scale to unit variance. Personally if I saw normalised I would assume scaled by a constant, not offset (as in subtraction).
- quietbritishjim 6y agoOne problem with the word normalised is that it implies that there is some true original value from before normalisation that isn't necessarily between 0 and 1. Of course if that's true then the word is ideal, but if not then it's confusing.
- negamax 6y agoProbability
- delaaxe 6y agoThis is the right answer for anyone in data science
- BerislavLopac 6y agoIsn't that simply a decimal fraction? https://en.wikipedia.org/wiki/Fraction#Decimal_fractions_and_percentages https://en.wikipedia.org/wiki/Fraction#Decimal_fractions_and...
- nicky0 6y agoDecimal fraction can be greater than one.
- BerislavLopac 6y agoProper decimal fraction?
- nicky0 6y agoExactly, in order to sufficiently specify the thing we are talking about we seem to need at least three words.
- ramshorns 6y ago> between 0 and 1 (inclusive) [closed] Why yes.
- rocqua 6y agoI 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.
- preommr 6y agoWhy 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%20mathematics%2C%20the%20unit%20interval,I%20(capital%20letter%20I) https://en.wikipedia.org/wiki/Unit_interval#:~:text=In%20mat... If you google accuracy, you'll get the noun. If you use a made up term, it'll probably return useless results.
- nicky0 6y agoUnit interval is the interval between 0 and 1. We need a word for a value within that interval.
- darepublic 6y agoCreating 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 6y agoSure, but then you still have to name the type.
- sanjay_316 6y agoUnitInterval 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 6y agoOthers 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.
- pwdisswordfish4 6y agoI 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 6y agoYeah, this is a pretty significant difference between a set and an element.
- Tainnor 6y agoThe fix is simple: Put the type of the variable in the type name. Then "UnitInterval proportion" tells you everything you need to know.
- tartrate 6y agoThat's three words though, and the SO OP asked for a single word.
- peterhil 6y agoI like this idea of using the type name to define the domain, and variable name to define the purpose.
- pwdisswordfish4 6y agoNames 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.
- deleted 6y ago[deleted]
- jberryman 6y agoI guess this is like "mammal" vs "mammalia".
- hinkley 6y ago
- tobr 6y agoIs 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 6y agoMaybe there should be an IRC group #namingthings on Freenode?
- heftig 6y agoSince 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.
- janee 6y agoDoes 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.
- andy_ppp 6y agoYes naming things is difficult and we would all benefit from shared names for the same things.
- lioeters 6y ago> boxes, pallets, containers and vessels Woo, that's a tough one. Even as a native speaker, I'd be hard-pressed to find one word in English that describes all these similar but different terms. I looked up some of these in a dictionary for definitions and synonyms. OK, the word "holder" seems to be the most general term that includes all these types of objects. So I'd name it "holder_events_table", with a column "holder_type" being box, pallet, etc. This issue of finding precise naming is related to "ontologies", how to establish an organization of agreed-upon terms to classify objects in the world. I agree with you, it would be valuable if there was a community-developed reference where we could search for the most appropriate names of things.
- janee 6y agoyeah I ended up leaning towards something similar, but avoided the whole issue of naming the "thing" by instead naming it based on the class of events contained in the table...ended up calling it tracking_events, and making it reference the "thing" as trackable_type,trackable_id (ala polymorphic relation in Rails world). but yeah, naming things...wonder how much time I've spent pondering over names in my career (probably too much haha)
- shultays 6y agoDepending on context I would use ratio saturated (if something is clamped to 0-1) normalized (if it is scaled down using a max value)
- lhnz 6y agoHow about we coin it now? We could call it a Thiel.
- deleted 6y ago[deleted]
- zucker42 6y agoI use proportion in this context.
- 8bitsrule 6y ago"zeroToOne" includes both values. "Given a number from zerotoone..."
- tobyhinloopen 6y agozeroToOne doesn’t include one
- cies 6y agoI 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).
- Kim_Bruning 6y agoPerunage seems to occur in the Dutch dictionary too.
- proto-n 6y agoWhile 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 6y agoI 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 6y agoWe 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).
- rocqua 6y agoReally the percentage sign just denotes a centi-1. Just like a centi-meter is 1 hundreths of the unit 'a meter', a percentage is 1 hundreths of the a (unitless) unit '1'.
- ivanhoe 6y agoIsn'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 6y agoWould 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
- Kim_Bruning 6y agoShoot. 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 6y agoIt 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 6y agoLooked it up, and a 'perunage' is defined as 'a percentage divided by a hundred'.
- Kim_Bruning 6y agoWhich 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 6y agoNot 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.
- mannykannot 6y agoSo it is synonymous with 'ratio'?
- eithed 6y agoPercentage. But in the code I'd probably use X_range depending on what 0..1 represents
- Tainnor 6y agopercentage is 0 to 100, though. (Or even more, saying 200% is not technically wrong depending on context)
- eithed 6y agoDepends 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 6y agoThat's like saying that inches are the same thing as yards because you can convert from one to the other.
- Izkata 6y agoWhat 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 6y agoSo 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 6y agoNo, 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.
- edejong 6y agoRelated 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)?
- agrajag 6y agoPractically? float/double. You probably don’t need any more precision and maintaining easy interoperability is more important. Otherwise you just want the mantissa stored as an int or byte[] until you need it to be converted to a floating point number.
- deleted 6y ago[deleted]
- uniqueid 6y agoI'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 6y agoYou'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.
- j-pb 6y agoAs 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 ;)
- globular-toast 6y ago*George Boole. I like this idea, although I don't think English speakers would know how to pronounce "zadehan" by default. "Zadean" might be better. I don't think it will catch on, though, because "boolean" is really easy to say but "zadean" isn't.
- eps 6y ago"Zad" means "rear" or "behind" in slavic languages and it's closely related to "butt" and "ass". So the appeal of your suggestion, as clever as it is, is definitely not universal :)
- dragonwriter 6y agoI'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 6y agoSure, 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 6y ago
- eps 6y agoI 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.
- skrebbel 6y agoI like this a lot, given how often it's used in scenarios similar to alpha blending, like "reducing the proportion of X".
- eru 6y agoSounds a bit too much like alphabet or alphanumeric?
- eps 6y agoNot to me. Especially when preceded by "float".
- twic 6y agoI also have the name "alpha" for numbers like this. I don't think i got it from graphics.
- Sandman 6y agoI 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.
- firstbabylonian 6y agoyeah, right, so what do you call such a type? I believe that is the actual question.
- StavrosK 6y agoThe question was about the parameter name, though. The correct answer seems to be: function FuncName(UnitInterval accuracy)
- elcomet 6y agoUnitInterval seems to contains an interval, not a single float. I don't think it's a very good name. UnitIntervalNumber would be better, but it's too long. Something like UnitNumber or UnitFloat could maybe work.
- peterhil 6y agoAfter reading this reply twice, I realised you are right and UnitInterval type indicates an interval object instead of a single scalar number. I have actually used intervals, and should have realised this sooner. But I just had my first cup of coffee...
- treeman79 6y agoPerhaps a word that means “Almost Nothing”. Piddling: amounting to very little; trifling; negligible
- eru 6y ago'Proper fraction' is very close in meaning. https://en.wikipedia.org/wiki/Fraction#Proper_and_improper_fractions https://en.wikipedia.org/wiki/Fraction#Proper_and_improper_f...
- mongol 6y agoFactor
- terom 6y agoIf 0-100 is a percent, then wouldn't 0-1 be a perun(something)? I don't know latin, but perun, perune, peruni?
- FabHK 6y agoPerunage, 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).
- browserface 6y agoRatio? 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 6y agoI always use ratio for this kind of number. Though it could be bigger than 1 since 120% == 1.2
- browserface 6y agoYes, 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 6y agoMaybe part_ratio? Because you can never take a bigger part than 100%.
- browserface 6y agoYeah, 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. :)
- Konohamaru 6y agoI propose "tegritage", combining "(in)tegrity" with "-age". A concrete number by analogy would be "0.753 tegrent".
- codeulike 6y agoClosed, of course Modoverflow strikes again
- neskiredk 6y agofunction FuncName(float ShouldBeAccurate) function FuncName(float AccuracyBoolean) function FuncName(float BoolAccuracy) function FuncName(float IsAccurate)
- RedNifre 6y agoIf 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)
- jonny383 6y agoTransgender / Genderfluid
- idefixy 6y agoextrapolating from "per-million" to "per-thousand" to "percent", how about "perone" or "perunit". foo_perunit = foo_percent/100.
- asah 6y agoGiven the lack of common language, IMHO describe it instead of being clever. Example: FractionInclusive
- mannykannot 6y agoAnyone 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.
- IshKebab 6y agoI use fraction. Better than any of the answers there.
- clktmr 6y agoNot true if the value refers to something like RGB color components.
- FabHK 6y agoIn 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.
- mlthoughts2018 6y ago> “ 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.
- seanwilson 6y agoMy 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.
- paozac 6y agoI 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.
- abecedarius 6y agoI'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.
- throwaway894345 6y ago> Booleans have the same problem that we lack a plain English short word for "yes or no answer". "Binary" is the term I use. E.g., "It's not a binary proposition" to call out a false dichotomy.
- dragonwriter 6y agoBinary means that there are exactly two choices, not that the choices are yes or no.
- throwaway894345 6y agoI understand, but context typically gets you the rest of the way. We're talking about natural languages after all; this is about as good as you can hope for.
- drdec 6y ago>'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.
- 6y ago
- Waterluvian 6y agoIs 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 6y agoFor booleans I generally stick to the `isX` format. So in your case, `isPositive` (or `isNegative` depending on your preference)
- Waterluvian 6y agoGood 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 6y agoIn mathematics, by a widely used convention, a clockwise rotation is negative.
- FabHK 6y agoLISP 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.
- kazinator 6y agoCommon Lisp calls it plusp.
- mcculley 6y agoFirst, use a better language. This is the syntax as I remember it from Ada: subtype Probability is Float range 0.0 .. 1.0;
- eternalban 6y agoFractional 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
- zachrose 6y agoA unit value is a value in the unit interval.
- laksdjfkasljdf 6y ago"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_ 6y agoA probability has to lie between 0 and 1 but not every value between 0 and 1 is a probability.
- laksdjfkasljdf 6y agothe probability of a "value between 0 and 1" to be an actual probability is very close to 1.
- layoutIfNeeded 6y agoSince it's a value in the unit interval, I call it "unance".
- pbhjpbhj 6y agoI 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 6y agoThat violates my organization's NAP, or "No Acronym Policy". No way I'll get an LGTM on any PR that includes that!
- fizzled 6y agoY'all are so uncreative. How about `float bool` or `fbool`. Or `fbit`... Or what about an `fowen`? (floating oh + one) ;-)
- visika 6y agoLooks like it could be a "probability".
- arbirk 6y agoit's called a share
- deleted 6y ago[deleted]
- mafia303 6y agoOnecentage
- shadowgovt 6y agoWeird 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 6y agoAmong 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 6y agoIt 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 6y agoNot 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.
- 6y ago
- gct 6y agoperunum
- __david__ 6y agoFloating point boolean: It can convey True, False and all the grey in between.
- klyrs 6y agoThis 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.
- ccleve 6y agoIn 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.
- tcbawo 6y agoI 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 6y agoThere 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 6y agoInteresting, 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".
- deleted 6y ago[deleted]
- deleted 6y ago[deleted]
- andromaton 6y agoWe could call it a "Thiel", after his book "Zero to One".