RE: Problem with where clause

2002-02-04 Thread Fochtman, Michael
> Er, no, > > 12.3399 < float_var < 12.3400 > > works fine. > > It is the = operation that doesn't. Remember that floating > point numbers I don't understand why you think inexact numbers won't compare, the originators comparison works for '12.3' works with several other types

Re: Suggestion re: floating point comparison (was Re: Problem with where clause)

2002-02-02 Thread Shankar Unni
[ database mysql query ] Sinisa Milivojevic wrote: >On Fri, 01 Feb 2002 15:21:07 -0800 >Steve Edberg <[EMAIL PROTECTED]> wrote: > >>...perhaps a NEAR function could be added; as a config file or >>compile-time option, you could define an accuracy range. Say, >> ./config --with-epsilon=0.0001 >

Re: Suggestion re: floating point comparison (was Re: Problem with where clause)

2002-02-02 Thread Sinisa Milivojevic
On Fri, 01 Feb 2002 15:21:07 -0800 Steve Edberg <[EMAIL PROTECTED]> wrote: > ...perhaps a NEAR function could be added; as a config file or > compile-time option, you could define an accuracy range. Say, > > ./config --with-epsilon=0.0001 > > (if memory of my numerical analysis classes

Suggestion re: floating point comparison (was Re: Problem with where clause)

2002-02-01 Thread Steve Edberg
...perhaps a NEAR function could be added; as a config file or compile-time option, you could define an accuracy range. Say, ./config --with-epsilon=0.0001 (if memory of my numerical analysis classes serves, the 'fudge factor' was conventionally symbolized by epsilon; I suppose you co

Re: Problem with where clause

2002-02-01 Thread Kyle Hayes
On Friday 01 February 2002 14:19, Jim Dickenson wrote: > Am I to assume that based on your response that one should never use a > float field type if you ever want to select the data? Er, no, 12.3399 < float_var < 12.3400 works fine. It is the = operation that doesn't. Remember that

Re: Problem with where clause

2002-02-01 Thread Shankar Unni
[ database query mysql ] Jim Dickenson wrote: > Am I to assume that based on your response that one should never use a float > field type if you ever want to select the data? No, that wasn't quite what he said. You can certainly select on a float field, as long as you perform a meaningful o

Re: Problem with where clause

2002-02-01 Thread James Montebello
Yes, but you need to use the decimal (fixed-point) type, not the floating point type. Any program that's directly comparing FP numbers for exact matches is simply wrong, and certainly won't be portable, even if it works in one particular environment. Fixed-point numbers CAN be compared for exac

Re: Problem with where clause

2002-02-01 Thread Jim Dickenson
Am I to assume that based on your response that one should never use a float field type if you ever want to select the data? This causes a big problem for the way MyODBC 3.51 has been implemented. I was actually debugging a problem I had in MyODBC when I ran across this. The way MyODBC works is t

Re: Problem with where clause

2002-02-01 Thread Paul DuBois
At 13:33 -0800 2/1/02, Jim Dickenson wrote: >I am running mysql Ver 11.15 Distrib 3.23.47, for pc-linux-gnu (i686) >installed from a binary RPM file. This is using RedHat Linux 7.2. > >I have a table described as: >mysql> describe junk; >++---+--+-+-+---+ >

Re: Problem with where clause

2002-02-01 Thread Gerald Clark
A floating point number can never be equal to 12.3. It can be close, and with rounding display as 12.3, but it won't actually be equal to 12.3. Use a decimal type instead. Jim Dickenson wrote: >I am running mysql Ver 11.15 Distrib 3.23.47, for pc-linux-gnu (i686) >installed from a binary RPM f

Problem with where clause

2002-02-01 Thread Jim Dickenson
I am running mysql Ver 11.15 Distrib 3.23.47, for pc-linux-gnu (i686) installed from a binary RPM file. This is using RedHat Linux 7.2. I have a table described as: mysql> describe junk; ++---+--+-+-+---+ | Field | Type | Null | Key | Default | E