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

Michael Day mikeday at bigpond.net.au
Mon May 20 13:54:51 AEST 2002


> Amidst all the sarcasm, I can't tell which way you're leaning :)

Well actually I think using / is justified for ints in Mercury due to the
fact that there are no implict type conversions between int and float. So
if you write X / Y you're going to get what you asked for to the precision
that the type of X and Y supports, whether they be ints, floats, integers,
whatever.

It doesn't seem worth pushing a strictly mathematical approach to the
naming of the operators, especially when some code divides by zero
intentionally as the result (+/-inf or nan? I can't remember...) can be
compared conveniently to avoid explicitly checking for special cases like
a slope of 0. Presumably in a truly mathematical language dividing by zero
would blow up the universe, or at least place all subsequent computation
on an extremely dubious foundation.

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