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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Oracle internal number format(s)

Re: Oracle internal number format(s)

From: Joel Shepherd <jashepherd_at_usa.net>
Date: 2000/07/18
Message-ID: <3LRc5.31552$6y5.21344825@news2.rdc2.tx.home.com>#1/1

Been there, seen that.

At best this dances around how a positive number may be encoded. It does not attempt to describe the goofy stuff they do with negative numbers.

In article <8kvqm5$gb8$15$1_at_news.t-online.com>, KZeuch_at_nospamhotmail.com says...
>
>From 8.1.6 Manual:
>"Internal Numeric Format
>Oracle stores numeric data in variable-length format. Each value is stored
>in scientific notation, with one byte used to store the exponent and up to
>20 bytes to store the mantissa. The resulting value is limited to 38 digits
>of precision. Oracle does not store leading and trailing zeros. For example,
>the number 412 is stored in a format similar to 4.12 x 102, with one byte
>used to store the exponent (2) and two bytes used to store the three
>significant digits of the mantissa (4, 1, 2). Negative numbers include the
>sign in their length.
>
>Taking this into account, the column size in bytes for a particular numeric
>data value NUMBER (p), where p is the precision of a given value, can be
>calculated using the following formula:
>
>ROUND((length(p)+s)/2))+1
>
>
>where s equals zero if the number is positive and s equals 1 if the number
>is negative.
>
>Zero and positive and negative infinity (only generated on import from
>Version 5 Oracle databases) are stored using unique representations. Zero
>and negative infinity each require one byte; positive infinity requires two
>bytes.
>
>"
>(Oracle 8i concepts Built-In Datatypes)
>
>hth
>
>Klaus
>"JShepherd" <jashepherd_at_usa.net> schrieb im Newsbeitrag
>news:sRIc5.364$7Y2.190336_at_news.uswest.net...
>> Is Oracles' internal format for numbers defined in a manual somewhere ?
>>
>> i.e.
>>
>> xC106 = 5
>> xC202 = 100
>> xC40D23394F = 12345678
>> x3B59432D1766 = -12345678
>>
>
>
Received on Tue Jul 18 2000 - 00:00:00 CDT

Original text of this message

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