"Pedro M. Ferreira" <[EMAIL PROTECTED]> writes: > Its like I said before, the guys from matlab (in x86 IEEE float) go to > DBL_BIG+3 to have 'maximum precision'.
Apparently they have not read the canonical papers in the field. [ googles for a moment... ] See How to read floating point numbers accurately William D. Clinger How to print floating-point numbers accurately Guy L. Steele, Jr., Jon L. White both published at the 1990 ACM Conference on Programming Language Design and Implementation and subsequently reprinted in ACM SIGPLAN Notices Volume 25, Issue 6 (June 1990). I was misremembering these papers to claim DBL_DIG+1 is enough, but actually they prove that DBL_DIG+2 is necessary and sufficient (and give code to do it correctly, too). Printing DBL_DIG+3 is just producing an extra garbage digit; it won't help matters. Any reasonably well-written C library is going to be able to reproduce a double value with DBL_DIG+2 digits of I/O; and if it's not well-written, I would have no confidence in its ability to do so with DBL_DIG+3 digits... regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]