Attila Soki wrote:
>
> hi,
>
> please help me... i can't understand why are my doubles incorrect.
>
> create table test (dnum double(20,5));
> insert into test values(8999999999999998);
> insert into test values(8999999999999998.0001);
> insert into test values(899999999999998.0001);
> insert into test values(89999999999998.0001);
> insert into test values(1.0001);
> select * from test;
> +------------------------+
> | dnum |
> +------------------------+
> | 8999999999999998.00000 |
> | 8999999999999997.00000 |<<<<<<<<<<<<<<< HERE
> | 899999999999998.00000 |<<<<<<<<<<<<<<< HERE
> | 89999999999998.00000 |<<<<<<<<<<<<<<< HERE
> | 1.00010 |
> +------------------------+
>
> intel PII-450 / debian-2.2.19 / mysql 3.23.32
> intel PIII-833 / debian-2.2.19 / mysql 3.23.37
>
> thanx
>
> Attila Soki
>
Hi,
You are asking for 20 digits precision; it cannot be
achieved with 'double' type. doubles are internally
stored as 64 bits IEEE floating point values which
have a maximum precision of 16 digits.
If you want arbitrary precision values, check 'decimal'
type.
Regards
--
Joseph Bueno
NetClub/Trader.com
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php