× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



"OpenSource" <opensource-bounces@xxxxxxxxxxxx> wrote on 07/15/2016
04:08:24 PM:

From: John Yeung <gallium.arsenide@xxxxxxxxx>
To: IBMi Open Source Roundtable <opensource@xxxxxxxxxxxx>
Date: 07/15/2016 04:08 PM
Subject: Re: [IBMiOSS] Field Length using node.js
Sent by: "OpenSource" <opensource-bounces@xxxxxxxxxxxx>
<snip>
Yes, we agree at this level. I mean, we both have the same
understanding of what the words "precision" and "scale" mean in
English.

But you have to be careful what "thing" it is you are talking about.

In CLI though, these terms are backwards from my expectations:
precision
is "how big is this thing" and scale is "how accurate is this thing."

OK. When I went into my diatribe about scientific notation, and the
precision of measurements, I was talking in terms of the thing being
measured. That is, at "astronomical scale", the measurement might be
the distance between galaxies. At that scale, if the measurement is
precise down to a few million miles, then we're talking seriously good
precision. On the other hand, if you're working at subatomic scale,
and you can't get measurements any finer than microns, your precision
is so poor as to be unusable.

So precision of a *measurement* isn't tied to the physical size of the
thing we're measuring. But when it comes time to STORE our
measurement, we need *more space* if we want to preserve greater
precision! If I take a 4 megapixel photo of an object, and you take a
40 megapixel photo of the very same object, from the same angle at the
same distance, the size of the object hasn't changed, but you need 10
times as much space to store your data. Your file is "bigger". But
your picture has more resolution (i.e. greater precision).

So yeah, a higher *precision* data field is *bigger* in terms of
computer storage. I mean, bottom line is you need more bytes to store
more digits.

What you need to remember is that "scale" doesn't refer to the file
size of the photo. It refers to the size of the thing you took a
picture of. Maybe it was mountains. Maybe it was insects. If you use
the same camera for both, all of your photos are 40 megapixel,
regardless. You've got 40-megapixel precision.

So, in SQL, the precision of a field corresponds to the resolution of
the photo. The scale tells you whether you shot mountains or insects.
Mountains are certainly bigger than insects. Maybe a (9 0) field is
for mountains and a (9 6) field is for insects. The fact that they
both have 9 total digits tells you you've used the same camera for
both.

John Y.

I appreciate what you're trying to say, but this explanation doesn't make
much more sense to me than the last. If it makes sense to you, then great.
A lot of people like mnemonics and they help them remember things, but I
hate them. I still remember to this day from high school chemistry we had
to learn about VSEPR and the teacher came up with some mnemonic to
remember it. I couldn't tell you what the mnemonic is, but I can tell you
it stands for Valence Shell Electron Pair Repulsion. It's a theory to
describe how electrons arrange themselves around the nucleus of an atom. I
just remember it as veh-sep-ur.

I'll just continue to remember that SQL has it backwards for some inane
reason, probably because the people who created SQL were not particularly
bright. :D


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.