List:General Discussion« Previous MessageNext Message »
From:Jerry Schwartz Date:September 7 2006 4:12pm
Subject:RE: Decimal versus Float Point Type
View as plain text  
Oooh, oooh, I know!

The difference is that, for example, .01 can be represented exactly in
decimal; but float types are binary, so .01 cannot be represented exactly.
This can lead to all kinds of trouble when doing arithmetic, the errors
accumulate. It's one reason why most people write their loops with "< x + 1"
rather than "= x". That gets past the problem, but if you are adding
together many values the final answer may be wrong.

Look at 23.1 of the manual.


Regards,

Jerry Schwartz
Global Information Incorporated
195 Farmington Ave.
Farmington, CT 06032

860.674.8796 / FAX: 860.674.8341

-----Original Message-----
From: Bruno Rodrigues Silva [mailto:brunors17@stripped]
Sent: Thursday, September 07, 2006 6:47 AM
To: mysql@stripped
Subject: Decimal versus Float Point Type

Dear all.

The MySQL Manual inform that Decimal Data Type is used
for represent exact-number, but like Float Point Data
Type, Decimal use rounding case the fractional part is
not sufficient. Therefore, what the difference?

Regards


Bruno R. Silva




_______________________________________________________
Novidade no Yahoo! Mail: receba alertas de novas mensagens no seu celular.
Registre seu aparelho agora!
http://br.mobile.yahoo.com/mailalertas/



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/mysql?unsub=1




Thread
Decimal versus Float Point TypeBruno Rodrigues Silva7 Sep
  • Re: Decimal versus Float Point TypeRenato Golin7 Sep
  • RE: Decimal versus Float Point TypeJerry Schwartz7 Sep
    • Re: Decimal versus Float Point TypeRenato Golin7 Sep
      • Re: Decimal versus Float Point TypeGerald L. Clark7 Sep
        • Re: Decimal versus Float Point TypeRenato Golin8 Sep
          • RE: Decimal versus Float Point TypeJerry Schwartz8 Sep
            • Re: Decimal versus Float Point TypeRenato Golin8 Sep