Arne Vajhøj said:
I have not invented the division between integer and floating point
devision. It was invented before I was born.
In that case I think you're redefining lossy
More seriously, I'm sure we both understand each other and agree on the
technicalities - but we treat information loss slightly differently.
I view it like the difference between a hash and encryption:
(key, plaintext) => (key, encrypted) under encryption
(key, encrypted) => (key, plaintext) under decryption - no information
loss
(key, plaintext) => (key, hash) under hashing
(key, plaintext) => ? - there's no inverse of hash
Now, although there *is* an intuitive inverse of division
(multiplication) it's not a "full" inverse (not trying to claim that as
a technical term!) in that given (x, x / y) you can't get back to y (or
given (x, y / x) you can't get back to y). I think of that as
information loss.
And I believe that it is based in math:
Computer integers is a non lossy implementation of math
integers (except due to limited range) while computer
floating point is a lossy implementation (not just due to
limited range) of math reals.
Both are subsets of a broader set. I'll certainly agree that the nature
of the subset is easier to understand for integers - but I'd also say
that with floating point (which includes decimal, btw) there's a well-
defined range of values which can be exactly represented. A given bit
pattern represents an exact real value - it's just that, unlike with
the integers, just because x < y, x and y being exactly representable
doesn't mean that all the members of the "larger" set between x and y
are exactly representable.
Integer division is a fundamental operation not just a
lossy division.
It's a fundamental operation which loses information.
Of course, now that you mention the range issue, addition is also lossy
in one way: if I start with x, add 1 a number of times (y) you can't
tell me afterwards the size of y - only the size of y mod 2^32 (or
whatever, depending on the type)
I think we may have drifter a little from the original topic by now,
mind you...