Bill,

----- Original Message ----- 
From: ""Bill Todd"" <[EMAIL PROTECTED]>
Newsgroups: mailing.database.myodbc
Sent: Monday, September 08, 2003 3:02 AM
Subject: DECIMAL math?


> Since DECIMAL fields are stored as strings how are calculations performed?
> Does MySQL use string math routines or does it convert the string to a
> double and use the double for the calculation?

decimal math is currently handled by converting the decimal type to a
double.

> The real question is, can floating point imprecision errors occur when
using
> the DECIMAL type?

I think yes, if you use a decimal with many significant numbers.

http://www.mysql.com/doc/en/Open_bugs.html

"
Calculation is done with BIGINT or DOUBLE (both are normally 64 bits long).
It depends on the function which precision one gets. The general rule is
that bit functions are done with BIGINT precision, IF, and ELT() with BIGINT
or DOUBLE precision and the rest with DOUBLE precision. One should try to
avoid using unsigned long long values if they resolve to be bigger than 63
bits (9223372036854775807) for anything else than bit fields. MySQL Server
4.0 has better BIGINT handling than 3.23.
"

This is a well-known problem. String-based arithmetic is coming in a future
version of MySQL.

I have a question, too: if you are the Bill Todd who posts to the Borland
newsgroups, what is the status of the new DBExpress driver for MySQL? The
problem in old drivers was that they established a new connection for each
individual SQL statement. Transactions and several other MySQL features did
not work because of that.

I saw some 4 weeks ago a Borland engineer mention that this is now fixed in
a beta release of the driver. Is it so?

> Bill

Best regards,

Heikki Tuuri
Innobase Oy
http://www.innodb.com
Foreign keys, transactions, and row level locking for MySQL
InnoDB Hot Backup - a hot backup tool for MySQL

Order MySQL technical support from https://order.mysql.com/



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to