[M3devel] Integer overflow

Tony Hosking hosking at cs.purdue.edu
Sun Jan 10 05:33:57 CET 2010


So, in my experiments with range checking on integers, I have been playing with the overflow case:

VAR s: CARDINAL := LAST(INTEGER);
BEGIN INC(s) END;

Should this fail at runtime with a range check error?

The language definition says that integer overflow may or may not be checked, depending on the implementation.  (See FloatMode.i3).

If it is not checked, is it reasonable that s takes on the value FIRST(INTEGER)?

Antony Hosking | Associate Professor | Computer Science | Purdue University
305 N. University Street | West Lafayette | IN 47907 | USA
Office +1 765 494 6001 | Mobile +1 765 427 5484




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20100109/aa4fb6ca/attachment-0001.html>


More information about the M3devel mailing list