> -----Original Message-----
> From: Obed Soto Déctor [mailto:[EMAIL PROTECTED]
> Sent: Monday, July 17, 2006 7:28 PM
> To: mysql@lists.mysql.com
> Subject: problem with double data
> 
> Hi, i'm sorry for my english, i'm from México and i'm gonna do my best,
> 
> i've made a store procedure but i have some problems becouse when a
> make a simple operation with double datas the result is not what i
> wait.
> 
> look
> 
> cantidad_origen = 30.5
> cantidad_ = 30.4
> suma = 0
> 
> UPDATE detalle_tanque set cantidad = ( cantidad_origen - cantidad_ -
> suma ) where id_detalle_transaccion = id_detalle_transaccion_origen
> and ctl_no=ctl_no_origen;
> 
> cantidad = 0.100000000000001
> 

Looks like your standard floating-point rounding error.  See
http://dev.mysql.com/doc/refman/5.0/en/numeric-type-overview.html which
says:  "A double-precision floating-point number is accurate to
approximately 15 decimal places."  If I counted right, the "errant 1" at the
end is in place 15, so that is accurate to approximately 15 places.

Tim



> i don't know what ....   im waiting
> 
> cantidad = 0.1
> 
> thanks  any help will be good for me
> 
> 
> 
> --
> http://www.obed.org.mx ---> blog
> 
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]


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

Reply via email to