I am looking for algorithms for efficient basic arithmetics (+, -, *, /
for real & integers and modulus for integers) for constant folding, where
range overflows are detectable. I am writing a compiler in Modula-2, so
that my main focus is the error detection and not the arithmetics
themselves.

Any help would be appreciated.

Thanks in advance,

Max Spring.
[There was an article by McKeeman in the June 1993 JCLT. Detecting overflow
is easy albeit tedious. -John]
--