Be more specific about detected errors

This commit is contained in:
Jeff Parsons 2017-02-17 13:38:34 -08:00 committed by Jeff Parsons
commit 55bb0252b7

View file

@ -296,7 +296,17 @@ class Int36 {
if (this.remainder) {
s += ':' + Int36.octal(this.remainder);
}
if (DEBUG && this.error) s += " error 0x" + this.error.toString(16);
if (DEBUG && this.error) {
if (this.error & Int36.ERROR.OVERFLOW) {
s += " overflow";
}
if (this.error & Int36.ERROR.UNDERFLOW) {
s += " underflow";
}
if (this.error & Int36.ERROR.DIVZERO) {
s += " divide-by-zero";
}
}
return s;
}