"Frederick W. Reimer" wrote: > > Nothing is wrong, that's just how computers work. Fractional numbers are > stored in a variety of formats on different platforms. Most support the > IEEE formats, but some use their own formats. In all cases, that I'm aware > of, the numbers are stored as a mantissa and exponent. The numbers are > "base 2", so certain base 10 numbers don't have an exact representation in > base 2, no matter how many bits are used in the mantissa. Other base 10 > numbers have problems with the "short" mantissa formats, but are represented > exactly with the "long" mantissa formats. thank you for the lesson, I probably have done too much database this time :o what I was really affraid was the BUT clause ... > > jctest=> select * from eigthyfive where (cs/csbytenthousand=10000); > > cs | csbytenthousand | csbyhundred > > ----+-----------------+------------- > > 88 | 0.0088 | 0.88 > > 86 | 0.0086 | 0.86 > > 84 | 0.0084 | 0.84 > > (3 rows) > > > > *** oh oh 85 disappeared ! *** > > > > BUT > > > > jctest=> select (85/0.0085=10000); > > ?column? > > ---------- > > t > > (1 row) ... It seems that this is due to the single precision (float4) instead of double precision (float) (and even with a test done in base 3 :P) BTW there is no round(float4) function thanks jc
begin:vcard n:Pazzaglia;Jean-Christophe tel;fax:+357 (0) 2 750 654 tel;work:+357 (0) 2 750 750 x-mozilla-html:FALSE url:http://www.albourne.com org:Albourne; adr:;;3, Demetiou Vikella Street;Nicosia;;1061;Cyprus version:2.1 email;internet:[EMAIL PROTECTED] note;quoted-printable:altenative [EMAIL PROTECTED] x-mozilla-cpt:;-6144 fn:Jean-Christophe Pazzaglia end:vcard