Programming/Math Question: Precision, Scale, and ...

Precision is (I think) the count of ALL digits in a number.* That means that in the number 1234.56, the precision is 6.

Scale is the number of digits after the decimal point. So in the above example, the scale is 2.

So what is the word that means “number of digits before the decimal point”? There is one, right? This information should be SO easy to locate–but it’s not.
*I have found a few sites that say the precision is the number before the decimal point, but that’s not how I learned it. Is it language dependent? If so, it shouldn’t be.

Knuth, God of Computer Science, defines precision as “the number of digits in a representation,” which would agree with your definition.

I dunno the answer to the other part, though.

S I G N I F I G N A N T N U M B E R ( S ) !

No, significant figures are all numbers, minus all zeroes at the start and end of the number. (convert it to a x 10[sup]b[/sup], and it’s the precision of a)

Thanks, spingears, but that’s not exactly what I’m looking for. A significant number, or digit, relies on a determination of accuracy. That is, if a number is considered to be accurate to three digits, than the significant digits in 10.312102 are 10.312. Therefore, “significant number” could refer to the digits prior to the decimal point, but only if the accuracy was predetermined as such.

Surely there is a term that refers specifically to the digits before the decimal point.

log[sub]10[/sub]

Bottom line - when encountering terms like this, you must consider the context. You may philosophically think there ought to be some consistency, but there isn’t, except within the bounds of specific usages.

For instance, in a printf format like “%6.2f”, the 2 is generally referred to as a “precision”, when it measures the number of digits displayed after the decimal point (“scale” in your terms). The 6 is a “width” or “length” and includes modifiers such as sign characters and the decimal point.

You supposed to convert everything into scientific notation. This removes any ambiguity as the whether leading or trailing 0’s are to be counted:



2 significant digits:
    1.23e+10
    1.23e-4

3 significant digits:
    1.230e+10
    1.230e-4


As regards the OP, the number of digits before the decimal point is closely related to but not exactly the same as “order of magnitude”, which is the power of 10 used to express the number in scientific notation. A number with 3 digits before the decimal point has an order of magnitude of 10^2. So you can express the equivalent concept by talking about order of magnitude.

More important to think in terms of mantissa & exponent, as implied by Terminus Est.

The last significant digit is the one with uncertainty. Trailing zeroes can be significant, and are definitely significant if they are after the decimal point. If you tell me that you measured something to be 1 meter, then I will assume that you measured with a 1-meter long stick with no graduations and your measurement could be off by up to 1 meter. But if you measured it to to be 1.000 meters then that implies that you are off by less than a millimeter. All those zeroes are significant. It’s more difficult if you tell me you measured 1000 meters, I can’t tell what your precision is. But if you tell me it’s 1000.0 meters then again all the zeroes are significant.

Oh, one other thing, the exception is if a number is an exact measurement, which can really only happen theoretically or by definition. For example, the length of the path traveled by light in vacuum during a time interval of 1/299 792 458 of a second is 1 meter. Not 1.0, or 1.00, but exactly 1 with absolute precision.

The part of the number before the decimal is known as the index or characteristic. The part that follows is called the mantissa.

Thanks to you all. I believe KoalaBear has come up with the most useful answer for my purposes. I am sure that yabob was right when he/she said:

In fact, one reason I had such a difficult time learning the programming meaning of “precision” (in Oracle, anyway) was that the common meaning has to do with the number of digits after the decimal point, or (thanks again, KoalaBear) the mantissa.

Again, thanks to all you math geeks (she said with genuine affection, being an English geek herself). I knew the SDMB wouldn’t let me down.

The digits before the dp are simply the digits before the dp.

The signifigant numbers (digits) before all the zeros and the dp are just that.
A string of digits after the dp before the signifigant numbers determine how small the overall number is. YOU define how many number are signifigant. i.e. if you are counting how may tons of corn is grown on a specific plot of land, you might ask for the weight in pounds or in four signifigant figures. If you are interested in how many ears of corn or how many grains you have to determine how many SF’s you want to go to the trouble of determining. Weigh 100 ears and compare to total weight or count them one by one.

Usually 4 or 5 SF’s are sufficient for most practical operations.

A mathematician might have more rigorous definitions.

:slight_smile:

From O.E.D.
index
8. Math.
a. Alg. A number or other symbol placed above and to the right of a quantity to denote a power or root: = exponent 2 a.
An integral index, as in x2, denotes a power; a fractional index, as in x1/2, a root; a negative index, the reciprocal of a power, as x-2 = unity divided by x2.
† b. The integral part, or characteristic, of a logarithm. Obs.
characteristic
3. Math. The whole number in a logarithm.
Mantissa
2. Math. The decimal part of a logarithm.

ALL of the above refers to logarithims.
The OP as I understood it was in reference to numbers in general.

As the farmer said when he kissed the cow, “Every man to his own taste!”:smiley:

Doggone it, spingears, you’re right. I totally missed the logarithm thing when I looked up the definitions for those words. Aarrrggghhh!!!

Okay, let me explain my quandary here. Basically, I am not doing ANY math. I am trying to explain to a programmer that in a particular text box on a web site we need to allow X number of digits before the decimal point and X number of digits after the decimal point. I have to do this sort of thing frequently (I’m a technical writer), and it seems very clumsy to me that there is no word that refers to the number of digits before the decimal point. Or, for that matter, the number of digits AFTER the decimal point. (You would be amazed at how many times I have to repeat those phrases within one document.)

How can there not be a word for this simple, simple concept? Someone, please help me. I’m getting desperate.

I don’t know of any words for it, but mantissa(log[sub]10/sub) + 1 will give you the number of digits before the decimal point.

Well, since I work for a database company, I just checked our manuals, and we also use precision for the total number of digits, and scale for the number of digits after the decimal point. The manual doesn’t give a name for the digits before the decimal point, but IMHO the best name would be the integer.

Then what we tell you here won’t help. There’s two sides to communication, and if your programmers don’t know the correct, official terminology, then it won’t matter if you do. My advice is to ask around among the programmers you work with, and either see if they already have some notation they use for this, or work out a notation with them.

You already have two perfectly good terms: precision and scale. If you need 3 digits before the decimal point and 2 digits after, then scale=2 and precision=3+2=5. Is it so hard to do addition?

Chronos: Sure it will. Any time I use a word that may be unfamiliar (but necessary), I define it within the document. (I even have a glossary section in the templates I use.) It doesn’t happen very often, but it does happen.

Terminus Est: No, it’s not hard to do addition, but when creating development specs, it’s best to be as clear and easily understood as possible if you want the ending product to turn out right. So, I suppose that despite the inelegance of the solution, the best way is to continue using the dreaded phrases.

I may invent an appropriate word. I’ll have to give it some thought.