The 85/0.0085 mistery ?
От | Jean-Christophe Pazzaglia |
---|---|
Тема | The 85/0.0085 mistery ? |
Дата | |
Msg-id | 39DDC562.87D352AD@albourne.com обсуждение исходный текст |
Ответы |
RE: The 85/0.0085 mistery ?
|
Список | pgsql-hackers |
Hi, Well, I discovered a strange behavior (ie 85/0.0085 <> 10000 ) Is my SQL wrong or is it postgres ? We are running 7.02 (but also 6.x) on a alpha (alphaev6) box. Thanks in advance. jc Here is a snapshot jctest=> create table eigthyfive ( cs float4, csbytenthousand float4, csbyhundred float); CREATE jctest=> insert into eigthyfive VALUES (88,0.0088,0.88); INSERT 7973003 1 jctest=> insert into eigthyfive VALUES (86,0.0086,0.86); INSERT 7973004 1 jctest=> insert into eigthyfive VALUES (85,0.0085,0.85); INSERT 7973005 1 jctest=> insert into eigthyfive VALUES (84,0.0084,0.84); INSERT 7973006 1 jctest=> select * from eigthyfive ;cs | csbytenthousand | csbyhundred ----+-----------------+-------------88 | 0.0088 | 0.8886 | 0.0086 | 0.8685 | 0.0085| 0.8584 | 0.0084 | 0.84 (4 rows) jctest=> select * from eigthyfive where (cs/csbytenthousand=10000);cs | csbytenthousand | csbyhundred ----+-----------------+-------------88 | 0.0088 | 0.8886 | 0.0086 | 0.8684 | 0.0084| 0.84 (3 rows) *** oh oh 85 disappeared ! *** BUT jctest=> select (85/0.0085=10000);?column? ----------t (1 row) jctest=> select * from eigthyfive where (cs/csbyhundred=100);cs | csbytenthousand | csbyhundred ----+-----------------+-------------88 | 0.0088 | 0.8886 | 0.0086 | 0.8685 | 0.0085| 0.8584 | 0.0084 | 0.84 (4 rows) ** 85 is back ** jctest=> insert into eigthyfive VALUES (85,0.00085); INSERT 7973007 1 jctest=> select * from eigthyfive where (cs/csbytenthousand=100000);cs | csbytenthousand | csbyhundred ----+-----------------+-------------85 | 0.00085 | (1 row)
В списке pgsql-hackers по дате отправления: