Thanks a lot, it worked with the double datatype!

On Fri, 14 Jun 2002, Michael Ivanyo wrote:

> I've had similar problems with this in my career and
> have come to the conclusion that one should always use
> double floats.  The problem is typically due to round
> off errors of the float type.  The extra bytes of the
> double type should resolve the problem.
> --Michael
> 
> --- Vandana <[EMAIL PROTECTED]> wrote:
> > 
> >     My table is as follows:
> > 
> >     Value           Distance
> >        (float)              (float)
> >      ----------------------------
> >     2.0             42.3
> >     1.0             56.9
> >     3.2             20.0
> >     1.3             18.5
> >     
> > 
> > 
> >     I issued a query, 
> > 
> > 'update table set value=4.0 where distance=42.3'
> > 
> >     But this doesn't work. This works fine with the
> > values 20.0 and
> > 18.5 and doesn't work with the values 42.3 and 56.9.
> > The problem, I
> > discerned, was with the floating point comparison.
> > Works fine with the 
> > rounded figures like, 20.0 and 18.5, while doesn't
> > work with others. Is 
> > this the reason? In case yes, how do I solve the
> > problem? I've tried 
> > creating the distance column with an explicitly
> > specified precision. But 
> > doesn't work that way either. 
> > 
> > 
> > 
> >
> ---------------------------------------------------------------------
> > 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
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! - Official partner of 2002 FIFA World Cup
> http://fifaworldcup.yahoo.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

Reply via email to