You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"Precision" is the total number of significant digits in a number (e.g. for 1.234, precision = 4, not 3). What you're using it for (decimal places) is usually called the "scale" #7
@drrcknlsn Thank you for the large number of sources. In the database world this represents a clear consensus of terminology.
Furthermore, I found an article on Numerical Precision from Wolfram which uses the terms precision and accuracy. These are equivalent to precision and scale as used in the database world. More to the point, it is clear that precision is never used to refer to digits to the right of the decimal point so this bug is now confirmed.
FYI, this kind of relates to the number_format() suggestion i had. Presuming that something to that effect will go in, this change seems like it'd be intertwined with it
@okdana That's interesting. Also, Wolfram uses the term accuracy, but accuracy is just a synonym for precision anyway. I think this places the terminology under dispute once more until more sources can authoritatively declare the correct naming.
I personally use 'precision' in conversation to describe number of decimal places, but i have a very poor grasp of mathematics, so idk. I did some Google research and i found the following:
I could only find a few specs that use 'precision' un-ambiguously to refer to decimal places:
PHP's round(), as previously mentioned
In dc, the 'precision value' sets the 'number of fraction digits'
Several are ambiguous, inconsistent, or irrelevant:
The POSIX C printf() specification uses 'precision' for both digits before radix (for %i) and digits after radix (for %f)
Almost all other languages with printf() or a similar (PHP, Perl, Python, Ruby) use the POSIX terminology for those features
Perl's Math::BigFloat uses 'precision' similarly to POSIX
I think it's probably valid outside of a formal arithmetic context to use 'precision' to refer to number of decimal places, but now that i know the 'proper' term, i would probably have used 'scale' instead, personally.
Activity
Bilge commentedon Dec 30, 2015
Is there a good source to verify this?
hikari-no-yume commentedon Dec 30, 2015
Compare http://www.thefreedictionary.com/precision and http://www.thefreedictionary.com/scale
Bilge commentedon Dec 30, 2015
I'm not sure if a dictionary is appropriate here since we're talking about mathematical usage of terms rather than English usage.
drrcknlsn commentedon Dec 31, 2015
Every major RDBMS you can think of uses the precision/scale terminology.
Bilge commentedon Dec 31, 2015
@drrcknlsn Thank you for the large number of sources. In the database world this represents a clear consensus of terminology.
Furthermore, I found an article on Numerical Precision from Wolfram which uses the terms precision and accuracy. These are equivalent to precision and scale as used in the database world. More to the point, it is clear that precision is never used to refer to digits to the right of the decimal point so this bug is now confirmed.
okdana commentedon Dec 31, 2015
FYI, this kind of relates to the
number_format()suggestion i had. Presuming that something to that effect will go in, this change seems like it'd be intertwined with itokdana commentedon Dec 31, 2015
btw, one can probably be forgiven for using 'precision' here, since PHP itself uses it the same way
Bilge commentedon Dec 31, 2015
@okdana That's interesting. Also, Wolfram uses the term accuracy, but accuracy is just a synonym for precision anyway. I think this places the terminology under dispute once more until more sources can authoritatively declare the correct naming.
okdana commentedon Jan 1, 2016
I personally use 'precision' in conversation to describe number of decimal places, but i have a very poor grasp of mathematics, so idk. I did some Google research and i found the following:
I could only find a few specs that use 'precision' un-ambiguously to refer to decimal places:
round(), as previously mentioneddc, the 'precision value' sets the 'number of fraction digits'Several are ambiguous, inconsistent, or irrelevant:
printf()specification uses 'precision' for both digits before radix (for%i) and digits after radix (for%f)printf()or a similar (PHP, Perl, Python, Ruby) use the POSIX terminology for those featuresMath::BigFloatuses 'precision' similarly to POSIXThese side-step the issue entirely:
number_format()uses$decimalsround()usesndigitsFloat.round()usesndigitsNumber.prototype.toFixed()usesdigitsNumberFormatand friends use 'fraction digits' to refer to digits after the radixMath.Round()in C#) usedecimalsThese use 'scale' for digits after the radix:
BigDecimal(c.f.setScale())bc, as well as its PHP bindings (c.f.bcscale())I think it's probably valid outside of a formal arithmetic context to use 'precision' to refer to number of decimal places, but now that i know the 'proper' term, i would probably have used 'scale' instead, personally.