List:Internals« Previous MessageNext Message »
From:Hagen Höpfner Date:May 24 2005 10:07am
Subject:Re: Storageformat of Decimal values ...
View as plain text  
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Olaf van der Spek wrote:
> On 5/24/05, Hagen Höpfner <hoepfner@stripped> wrote:
> 
>>-----BEGIN PGP SIGNED MESSAGE-----
>>Hash: SHA1
>>
>>Dear List,
>>
>>I currently try to figure out, how decimal values are stored in MySQL. I
>>read about the changes in 5.0.3 but could not comprehend it under 5.0.4
>>beta. However,
>>
>>http://dev.mysql.com/doc/mysql/en/precision-math-decimal-changes.html
>>
>>mentioned, that 9 digits of a decimal value are stored in 4 byte. That
>>means, that Decimal(18,9) as well as Decimal(1,0) requires 8 Byte (4 for
>>the integer part and 4 for the fractional part). A Decimal (20,10)
> 
> 
> Is the fractional part stored by itself?

So it was written on the website listed above: "For example, a
DECIMAL(18,9) column has nine digits on each side of the decimal point,
so the integer part and the fractional part each require four bytes."

> Maybe the integer and fractional parts are combined such that 0.0013
> is simply stored as 13 and 1 is stored as 10000.

*Hm*, I will check this idea ...

Hagen



- --
- ------------------------------------------------------------
Dr.-Ing. Hagen Höpfner | hoepfner@stripped | +49 7251 700 239
- ------------------------------------------------------------
         http://www.i-u.de/schools/hopfner/index.html

             International University in Germany
               School of Information Technology
                  Campus 3  D-76646 Bruchsal
- ------------------------------------------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (MingW32)
Comment: GnuPT 2.6.0 by EQUIPMENTE.DE
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD4DBQFCkvzKataeEpWdQtYRApZfAJ9iByimI8BeeGAHPe6ueX3cU0JV9ACYjI3X
Z8jOpQQT5dxCqszbCeFBWw==
=CZ55
-----END PGP SIGNATURE-----
Thread
Storageformat of Decimal values ...Hagen Höpfner24 May
  • Re: Storageformat of Decimal values ...Olaf van der Spek24 May
    • Re: Storageformat of Decimal values ...Hagen Höpfner24 May
  • Re: Storageformat of Decimal values ...Sergei Golubchik24 May
    • Re: Storageformat of Decimal values ...Hagen Höpfner24 May
      • Re: Storageformat of Decimal values ...Sergei Golubchik25 May
        • Re: Storageformat of Decimal values ...Hagen Höpfner25 May
          • Re: Storageformat of Decimal values ...Sergei Golubchik25 May