> The reality is
> that FP ops are defined only on a discrete set, and yield
> values only on a discrete set. They are not defined on the
> reals. The reals are a different set, and have different
> operations on them. The fact that 0.7 is not representable
> by a binary floating point number no more implies that
> FP math is inexact, than does the exact same statement
> that 7 / 10 in integers is 0. The result is not inexact,
> nor incorrect. It is exact. It is correct. It just isn't the
> same as what you get when you use reals instead of integers.

The problem with this line of reasoning is that the floating point
numbers are only useful insofar as they approximate real numbers.  You
wouldn't choose to use a floating-point representation on any
mathematical basis for being a 'discrete set' with special properties.
 So with regard to their applicability, they are only approximations
of an ideal (which are real numbers).  Hence the term 'inexact'.  To
say the result is what you want because it is a member of a 'discrete
set' is misleading.  It's more accurate to say you're accepting a
certain amount of error because it's inconvenient to represent the
desired result.

The set of integers, on the other hand, are often exact in their
intended use.  If they are used to count discrete objects, you can
add, subtract, multiply and divide (you can use the modulus to retain
the precise remainder of a division).  If they are use as integers,
their operations are precisely what you want, without any error.
However, if you chose to use integers as a fixed point representation
of real numbers, I'd argue that this representation is inexact, just
like floating-point representation.

http://xkcd.com/386/

Drew
_______________________________________________
Prime mailing list
[email protected]
http://hogranch.com/mailman/listinfo/prime

Reply via email to