[m-rev.] Added int:'/'/2 and builtin false/0

Michael Day mikeday at bigpond.net.au
Fri May 17 18:48:42 AEST 2002


> Well, floating point division is not guaranteed to satisfy
> X * (Y / X) = Y, so perhaps we should have a special name for that, too?

ints of limited size can wrap around, so X + 1 < X => 1 < 0

Similarly with subtraction... I propose we rename all the integer
operators taking advantage of Mercury's ability to quote identifiers:

Y = X '+ (this may wrap around)' 1
Z = Y '/ (this truncates and is not exact)' X

That way the programmer can't possibly get it wrong, and will not be able 
to make the kind of stupid integer/float/rounding/truncation assumptions 
that led to the failed Arianne 5, for example.

Michael

--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list