Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Storing trailing zeros in mantissa

Re: Storing trailing zeros in mantissa

From: Noons <wizofoz2k_at_yahoo.com.au.nospam>
Date: Sat, 2 Aug 2003 10:15:56 +1000
Message-ID: <3f2b02ec$2$10357$afc38c87@news.optusnet.com.au>


<ctcgag_at_hotmail.com> wrote in message news:20030801122021.888$dk_at_newsreader.com...

> You and Norm clearly are not scientists! The difference between
> 10.2 and 1.02e1 is purely one of display, the difference between
> 10.2 and 10.20 is not, they differ in the number of significant
> digits. The fact that Oracle (nor any other RDBMS or programming
> language I'm aware) does not support this does not mean it isn't
> real. We're left with the options of either storing them
> as varchar2 (Ugh ugh), or using two columns, one for the number
> and one for the precision (Ugh) (or, one for the number in numeric
> form, and one the number in string form).
>

Then why bother with storing the thing as a NUMBER in the first place? I mean, if what is important is the number of significant digits and NUMBER(4,2) is not enough to carry that? Last time I looked, 10.20 is not more significant than 10.2, in any mathematics system. But I may be wrong. Fixed point arithmetic is not the same as significant digits.

I think the problem here is that the OP wants to add representation and value and store both.

>
> Wouldn't make sense to whom, to oci and odbc, or to the end user?
> It would make sense to me!
>
> 10.2 is somewhere around 10.15 to 10.25, whereas
> 10.20 is somwhere around 10.195 to 10.205 and
> 10.2000 is somewhere around 10.19995 to 10.20005
> (of course, the last wouldn't be allowed with the given
> column definition.)

Like I said, if numbers are "somewhere" between values, then you need an entirely new numbering system that is not supported anywhere natively. Hence, you're stuck with storing the value and its interpretation. Be that string or number is a design choice.

Either that or there was no point in getting Gauss involved in arithmetic... :D

> real-world precision, then it can be hard-coded as you suggest. But
> if each row can have a different number of sig figs beyond the decimal,
> which seems to be the case, then that information needs to be stored in
> some auxilliary manner.
>

Precisely. What we have here is a need for an entirely new system to represent numbers. One that includes how the number is written in the first place.

Perfect case study for an object type in Oracle? Kind of like the examples with imaginary numbers? The only way I can see this being done without major pain.

--
Cheers
Nuno Souto
wizofoz2k_at_yahoo.com.au.nospam
Received on Fri Aug 01 2003 - 19:15:56 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US