From: Bruno Haible <haible@il...>  20020828 17:30:51

Raymond Toy writes: > You want to treat all FP numbers as intervals. Yes. > I want to treat them as exact rationals. This point of view is justified in C or Fortran  which lack builtin RATIONAL number type, but in Lisp and Scheme, where we have the distinction between exact rationals and inexact floatingpoint numbers. > Pretending that every FP number is an interval seems somewhat wrong, > because when I write 2.0, maybe it's really from the interval [1.5, > 2.5). You can't know thatonly I know that. The ideal floating point data type contains the midpoint of the interval and an estimation of the length of the interval. Some computer algebra systems get this right. In Lisp, we only have 4 possible values for the interval length: short/single/double/long float precision. Still the precision of a rational is *way* different, because it is an infinitely short interval. > I think computer should compute things as accurately as possible, > without trying to guess what the numbers might have meant. I think computers should keep track about the accuracy. We have a rule that rationals may be replaced by floats during computations (CLHS 12.1.3.3. Rule of Float Substitutability), but never the converse. > produce the even less biased result of #c(25.0 0.0). :) Why not :) Bruno 