From 55bb0252b79e8dc3f932677fd28351a206c583bf Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Fri, 17 Feb 2017 13:38:34 -0800 Subject: [PATCH] Be more specific about detected errors --- modules/shared/lib/int36.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/shared/lib/int36.js b/modules/shared/lib/int36.js index 7351c45f8..e475ddefd 100644 --- a/modules/shared/lib/int36.js +++ b/modules/shared/lib/int36.js @@ -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; }