Henning Thielemann <[email protected]> wrote:
>
>> A code doing addition and substraction of some sort.
>> A property such as "X = (X add Y) sub Y" is easily falsifiable when
>> the number of bits of your integer is too small for your numbers.
>
> Since fix-width words represent modulo-arithmetic, your law would even hold
> in case of overflows.

True in this very example, but it's overly simplistic and I chose it
just for the
sake of illustration.
A property such as "X = (X mul Y) div Y", with Y != 0 (of course ;-),
Y prime wrt
2^nbBits (nbBits being the size of your integers), and the intermediate product
exceeding 2^nbBits would fail miserably...

--Serge

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to