summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Weinand <bobwei9@hotmail.com>2015-07-02 01:54:08 +0200
committerBob Weinand <bobwei9@hotmail.com>2015-07-02 02:20:58 +0200
commit007d7ac7ca6d52ba5e7a0ba7b2c582a04ddc50df (patch)
tree1a3615bd2fb103b7a0e9703fd869891613a57510
parentf9724b93f6592d2f77fa9165038a0ba0db3da0c6 (diff)
downloadphp-git-007d7ac7ca6d52ba5e7a0ba7b2c582a04ddc50df.tar.gz
Use DivisionByZeroError instead of exception for %/intdiv()
-rw-r--r--Zend/tests/bug69957.phpt12
-rw-r--r--Zend/tests/compound_assign_with_numeric_strings.phpt8
-rw-r--r--Zend/tests/mod_001.phpt6
-rw-r--r--Zend/zend_exceptions.c5
-rw-r--r--Zend/zend_exceptions.h1
-rw-r--r--Zend/zend_operators.c2
-rw-r--r--Zend/zend_vm_def.h2
-rw-r--r--Zend/zend_vm_execute.h18
-rw-r--r--ext/standard/math.c8
-rw-r--r--ext/standard/tests/math/intdiv.phpt4
-rw-r--r--tests/lang/operators/modulus_basiclong_64bit.phpt34
-rw-r--r--tests/lang/operators/modulus_variationStr.phpt786
12 files changed, 446 insertions, 440 deletions
diff --git a/Zend/tests/bug69957.phpt b/Zend/tests/bug69957.phpt
index 7f2c76b918..5aa0edab21 100644
--- a/Zend/tests/bug69957.phpt
+++ b/Zend/tests/bug69957.phpt
@@ -64,16 +64,16 @@ try {
float(INF)
Variable mod
-Type: Exception
-Message: Division by zero
+Type: DivisionByZeroError
+Message: Modulo by zero
float(INF)
Literal mod
-Type: Exception
-Message: Division by zero
+Type: DivisionByZeroError
+Message: Modulo by zero
float(INF)
Double mod
-Type: Exception
-Message: Division by zero
+Type: DivisionByZeroError
+Message: Modulo by zero
diff --git a/Zend/tests/compound_assign_with_numeric_strings.phpt b/Zend/tests/compound_assign_with_numeric_strings.phpt
index 518ed9ee7e..fbfc1605ec 100644
--- a/Zend/tests/compound_assign_with_numeric_strings.phpt
+++ b/Zend/tests/compound_assign_with_numeric_strings.phpt
@@ -11,7 +11,7 @@ $n = "-1";
try {
$n <<= $n;
var_dump($n);
-} catch (Exception $e) {
+} catch (Throwable $e) {
echo "\nException: " . $e->getMessage() . "\n";
}
@@ -23,7 +23,7 @@ $n = "-1";
try {
$n >>= $n;
var_dump($n);
-} catch (Exception $e) {
+} catch (Throwable $e) {
echo "\nException: " . $e->getMessage() . "\n";
}
@@ -31,7 +31,7 @@ $n = "0";
try{
$n %= $n;
var_dump($n);
-} catch (Exception $e) {
+} catch (Throwable $e) {
echo "\nException: " . $e->getMessage() . "\n";
}
@@ -46,5 +46,5 @@ int(0)
Exception: Bit shift by negative number
-Exception: Division by zero
+Exception: Modulo by zero
int(0)
diff --git a/Zend/tests/mod_001.phpt b/Zend/tests/mod_001.phpt
index 8dda405abf..ff589e2fee 100644
--- a/Zend/tests/mod_001.phpt
+++ b/Zend/tests/mod_001.phpt
@@ -9,12 +9,12 @@ $b = array();
try {
$c = $a % $b;
var_dump($c);
-} catch (Exception $e) {
+} catch (Throwable $e) {
echo "Exception: " . $e->getMessage() . "\n";
}
echo "Done\n";
?>
---EXPECTF--
-Exception: Division by zero
+--EXPECT--
+Exception: Modulo by zero
Done
diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c
index b0547b07a9..9f5b2448d1 100644
--- a/Zend/zend_exceptions.c
+++ b/Zend/zend_exceptions.c
@@ -31,6 +31,7 @@
#include "zend_smart_str.h"
ZEND_API zend_class_entry *zend_ce_throwable;
+ZEND_API zend_class_entry *zend_ce_division_by_zero_error;
static zend_class_entry *default_exception_ce;
static zend_class_entry *error_exception_ce;
@@ -853,6 +854,10 @@ void zend_register_default_exception(void) /* {{{ */
INIT_CLASS_ENTRY(ce, "TypeError", NULL);
type_error_ce = zend_register_internal_class_ex(&ce, error_ce);
type_error_ce->create_object = zend_default_exception_new;
+
+ INIT_CLASS_ENTRY(ce, "DivisionByZeroError", NULL);
+ zend_ce_division_by_zero_error = zend_register_internal_class_ex(&ce, error_ce);
+ zend_ce_division_by_zero_error->create_object = zend_default_exception_new;
}
/* }}} */
diff --git a/Zend/zend_exceptions.h b/Zend/zend_exceptions.h
index 944fe555ce..f07bc78b88 100644
--- a/Zend/zend_exceptions.h
+++ b/Zend/zend_exceptions.h
@@ -27,6 +27,7 @@
BEGIN_EXTERN_C()
extern ZEND_API zend_class_entry *zend_ce_throwable;
+extern ZEND_API zend_class_entry *zend_ce_division_by_zero_error;
ZEND_API void zend_exception_set_previous(zend_object *exception, zend_object *add_previous);
ZEND_API void zend_exception_save(void);
diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c
index 7abd978079..a669cc206c 100644
--- a/Zend/zend_operators.c
+++ b/Zend/zend_operators.c
@@ -1157,7 +1157,7 @@ ZEND_API int ZEND_FASTCALL mod_function(zval *result, zval *op1, zval *op2) /* {
if (op2_lval == 0) {
/* modulus by zero */
if (EG(current_execute_data) && !CG(in_compilation)) {
- zend_throw_exception_ex(NULL, 0, "Division by zero");
+ zend_throw_exception_ex(zend_ce_division_by_zero_error, 0, "Modulo by zero");
} else {
zend_error_noreturn(E_ERROR, "Division by zero");
}
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index 66398e5bfa..294a9ba9c7 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -189,7 +189,7 @@ ZEND_VM_HANDLER(5, ZEND_MOD, CONST|TMPVAR|CV, CONST|TMPVAR|CV)
result = EX_VAR(opline->result.var);
if (UNEXPECTED(Z_LVAL_P(op2) == 0)) {
SAVE_OPLINE();
- zend_throw_exception_ex(NULL, 0, "Division by zero");
+ zend_throw_exception_ex(zend_ce_division_by_zero_error, 0, "Modulo by zero");
HANDLE_EXCEPTION();
} else if (UNEXPECTED(Z_LVAL_P(op2) == -1)) {
/* Prevent overflow error/crash if op1==ZEND_LONG_MIN */
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index 994a15859c..729ad1be6d 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -4493,7 +4493,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MOD_SPEC_CONST_CONST_HANDLER(Z
result = EX_VAR(opline->result.var);
if (UNEXPECTED(Z_LVAL_P(op2) == 0)) {
SAVE_OPLINE();
- zend_throw_exception_ex(NULL, 0, "Division by zero");
+ zend_throw_exception_ex(zend_ce_division_by_zero_error, 0, "Modulo by zero");
HANDLE_EXCEPTION();
} else if (UNEXPECTED(Z_LVAL_P(op2) == -1)) {
/* Prevent overflow error/crash if op1==ZEND_LONG_MIN */
@@ -8516,7 +8516,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MOD_SPEC_CONST_CV_HANDLER(ZEND
result = EX_VAR(opline->result.var);
if (UNEXPECTED(Z_LVAL_P(op2) == 0)) {
SAVE_OPLINE();
- zend_throw_exception_ex(NULL, 0, "Division by zero");
+ zend_throw_exception_ex(zend_ce_division_by_zero_error, 0, "Modulo by zero");
HANDLE_EXCEPTION();
} else if (UNEXPECTED(Z_LVAL_P(op2) == -1)) {
/* Prevent overflow error/crash if op1==ZEND_LONG_MIN */
@@ -10391,7 +10391,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MOD_SPEC_CONST_TMPVAR_HANDLER(
result = EX_VAR(opline->result.var);
if (UNEXPECTED(Z_LVAL_P(op2) == 0)) {
SAVE_OPLINE();
- zend_throw_exception_ex(NULL, 0, "Division by zero");
+ zend_throw_exception_ex(zend_ce_division_by_zero_error, 0, "Modulo by zero");
HANDLE_EXCEPTION();
} else if (UNEXPECTED(Z_LVAL_P(op2) == -1)) {
/* Prevent overflow error/crash if op1==ZEND_LONG_MIN */
@@ -30189,7 +30189,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MOD_SPEC_CV_CONST_HANDLER(ZEND
result = EX_VAR(opline->result.var);
if (UNEXPECTED(Z_LVAL_P(op2) == 0)) {
SAVE_OPLINE();
- zend_throw_exception_ex(NULL, 0, "Division by zero");
+ zend_throw_exception_ex(zend_ce_division_by_zero_error, 0, "Modulo by zero");
HANDLE_EXCEPTION();
} else if (UNEXPECTED(Z_LVAL_P(op2) == -1)) {
/* Prevent overflow error/crash if op1==ZEND_LONG_MIN */
@@ -35497,7 +35497,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MOD_SPEC_CV_CV_HANDLER(ZEND_OP
result = EX_VAR(opline->result.var);
if (UNEXPECTED(Z_LVAL_P(op2) == 0)) {
SAVE_OPLINE();
- zend_throw_exception_ex(NULL, 0, "Division by zero");
+ zend_throw_exception_ex(zend_ce_division_by_zero_error, 0, "Modulo by zero");
HANDLE_EXCEPTION();
} else if (UNEXPECTED(Z_LVAL_P(op2) == -1)) {
/* Prevent overflow error/crash if op1==ZEND_LONG_MIN */
@@ -38228,7 +38228,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MOD_SPEC_CV_TMPVAR_HANDLER(ZEN
result = EX_VAR(opline->result.var);
if (UNEXPECTED(Z_LVAL_P(op2) == 0)) {
SAVE_OPLINE();
- zend_throw_exception_ex(NULL, 0, "Division by zero");
+ zend_throw_exception_ex(zend_ce_division_by_zero_error, 0, "Modulo by zero");
HANDLE_EXCEPTION();
} else if (UNEXPECTED(Z_LVAL_P(op2) == -1)) {
/* Prevent overflow error/crash if op1==ZEND_LONG_MIN */
@@ -41301,7 +41301,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MOD_SPEC_TMPVAR_CONST_HANDLER(
result = EX_VAR(opline->result.var);
if (UNEXPECTED(Z_LVAL_P(op2) == 0)) {
SAVE_OPLINE();
- zend_throw_exception_ex(NULL, 0, "Division by zero");
+ zend_throw_exception_ex(zend_ce_division_by_zero_error, 0, "Modulo by zero");
HANDLE_EXCEPTION();
} else if (UNEXPECTED(Z_LVAL_P(op2) == -1)) {
/* Prevent overflow error/crash if op1==ZEND_LONG_MIN */
@@ -43731,7 +43731,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MOD_SPEC_TMPVAR_CV_HANDLER(ZEN
result = EX_VAR(opline->result.var);
if (UNEXPECTED(Z_LVAL_P(op2) == 0)) {
SAVE_OPLINE();
- zend_throw_exception_ex(NULL, 0, "Division by zero");
+ zend_throw_exception_ex(zend_ce_division_by_zero_error, 0, "Modulo by zero");
HANDLE_EXCEPTION();
} else if (UNEXPECTED(Z_LVAL_P(op2) == -1)) {
/* Prevent overflow error/crash if op1==ZEND_LONG_MIN */
@@ -44894,7 +44894,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MOD_SPEC_TMPVAR_TMPVAR_HANDLER
result = EX_VAR(opline->result.var);
if (UNEXPECTED(Z_LVAL_P(op2) == 0)) {
SAVE_OPLINE();
- zend_throw_exception_ex(NULL, 0, "Division by zero");
+ zend_throw_exception_ex(zend_ce_division_by_zero_error, 0, "Modulo by zero");
HANDLE_EXCEPTION();
} else if (UNEXPECTED(Z_LVAL_P(op2) == -1)) {
/* Prevent overflow error/crash if op1==ZEND_LONG_MIN */
diff --git a/ext/standard/math.c b/ext/standard/math.c
index 33c83626a1..cdfb486c4f 100644
--- a/ext/standard/math.c
+++ b/ext/standard/math.c
@@ -1467,16 +1467,16 @@ PHP_FUNCTION(intdiv)
}
if (divisor == 0) {
- zend_throw_exception_ex(NULL, 0, "Division by zero");
+ zend_throw_exception_ex(zend_ce_division_by_zero_error, 0, "Division by zero");
return;
} else if (divisor == -1 && numerator == ZEND_LONG_MIN) {
- /* Prevent overflow error/crash
+ /* Prevent overflow error/crash ... really should not happen:
We don't return a float here as that violates function contract */
- zend_throw_exception_ex(NULL, 0, "Division of PHP_INT_MIN by -1 is not an integer");
+ zend_error(E_ERROR | E_EXCEPTION, "Division of PHP_INT_MIN by -1 is not an integer");
return;
}
- RETURN_LONG(numerator/divisor);
+ RETURN_LONG(numerator / divisor);
}
/* }}} */
diff --git a/ext/standard/tests/math/intdiv.phpt b/ext/standard/tests/math/intdiv.phpt
index 9362be638f..b441cb0a86 100644
--- a/ext/standard/tests/math/intdiv.phpt
+++ b/ext/standard/tests/math/intdiv.phpt
@@ -10,12 +10,12 @@ var_dump(intdiv(PHP_INT_MAX, PHP_INT_MAX));
var_dump(intdiv(PHP_INT_MIN, PHP_INT_MIN));
try {
var_dump(intdiv(PHP_INT_MIN, -1));
-} catch (Exception $e) {
+} catch (Throwable $e) {
echo "Exception: " . $e->getMessage() . "\n";
}
try {
var_dump(intdiv(1, 0));
-} catch (Exception $e) {
+} catch (Throwable $e) {
echo "Exception: " . $e->getMessage() . "\n";
}
diff --git a/tests/lang/operators/modulus_basiclong_64bit.phpt b/tests/lang/operators/modulus_basiclong_64bit.phpt
index 3fef77d85c..c2db77c120 100644
--- a/tests/lang/operators/modulus_basiclong_64bit.phpt
+++ b/tests/lang/operators/modulus_basiclong_64bit.phpt
@@ -27,7 +27,7 @@ foreach ($longVals as $longVal) {
echo "--- testing: $longVal % $otherVal ---\n";
try {
var_dump($longVal%$otherVal);
- } catch (Exception $e) {
+ } catch (Throwable $e) {
echo "Exception: " . $e->getMessage() . "\n";
}
}
@@ -38,7 +38,7 @@ foreach ($otherVals as $otherVal) {
echo "--- testing: $otherVal % $longVal ---\n";
try {
var_dump($otherVal%$longVal);
- } catch (Exception $e) {
+ } catch (Throwable $e) {
echo "Exception: " . $e->getMessage() . "\n";
}
}
@@ -48,7 +48,7 @@ foreach ($otherVals as $otherVal) {
===DONE===
--EXPECT--
--- testing: 9223372036854775807 % 0 ---
-Exception: Division by zero
+Exception: Modulo by zero
--- testing: 9223372036854775807 % 1 ---
int(0)
--- testing: 9223372036854775807 % -1 ---
@@ -66,7 +66,7 @@ int(1)
--- testing: 9223372036854775807 % 9223372036854775807 ---
int(0)
--- testing: -9223372036854775808 % 0 ---
-Exception: Division by zero
+Exception: Modulo by zero
--- testing: -9223372036854775808 % 1 ---
int(0)
--- testing: -9223372036854775808 % -1 ---
@@ -84,7 +84,7 @@ int(-2)
--- testing: -9223372036854775808 % 9223372036854775807 ---
int(-1)
--- testing: 2147483647 % 0 ---
-Exception: Division by zero
+Exception: Modulo by zero
--- testing: 2147483647 % 1 ---
int(0)
--- testing: 2147483647 % -1 ---
@@ -102,7 +102,7 @@ int(0)
--- testing: 2147483647 % 9223372036854775807 ---
int(2147483647)
--- testing: -2147483648 % 0 ---
-Exception: Division by zero
+Exception: Modulo by zero
--- testing: -2147483648 % 1 ---
int(0)
--- testing: -2147483648 % -1 ---
@@ -120,7 +120,7 @@ int(-1)
--- testing: -2147483648 % 9223372036854775807 ---
int(-2147483648)
--- testing: 9223372034707292160 % 0 ---
-Exception: Division by zero
+Exception: Modulo by zero
--- testing: 9223372034707292160 % 1 ---
int(0)
--- testing: 9223372034707292160 % -1 ---
@@ -138,7 +138,7 @@ int(1)
--- testing: 9223372034707292160 % 9223372036854775807 ---
int(9223372034707292160)
--- testing: -9223372034707292160 % 0 ---
-Exception: Division by zero
+Exception: Modulo by zero
--- testing: -9223372034707292160 % 1 ---
int(0)
--- testing: -9223372034707292160 % -1 ---
@@ -156,7 +156,7 @@ int(-1)
--- testing: -9223372034707292160 % 9223372036854775807 ---
int(-9223372034707292160)
--- testing: 2147483648 % 0 ---
-Exception: Division by zero
+Exception: Modulo by zero
--- testing: 2147483648 % 1 ---
int(0)
--- testing: 2147483648 % -1 ---
@@ -174,7 +174,7 @@ int(1)
--- testing: 2147483648 % 9223372036854775807 ---
int(2147483648)
--- testing: -2147483649 % 0 ---
-Exception: Division by zero
+Exception: Modulo by zero
--- testing: -2147483649 % 1 ---
int(0)
--- testing: -2147483649 % -1 ---
@@ -192,7 +192,7 @@ int(-2)
--- testing: -2147483649 % 9223372036854775807 ---
int(-2147483649)
--- testing: 4294967294 % 0 ---
-Exception: Division by zero
+Exception: Modulo by zero
--- testing: 4294967294 % 1 ---
int(0)
--- testing: 4294967294 % -1 ---
@@ -210,7 +210,7 @@ int(0)
--- testing: 4294967294 % 9223372036854775807 ---
int(4294967294)
--- testing: 4294967295 % 0 ---
-Exception: Division by zero
+Exception: Modulo by zero
--- testing: 4294967295 % 1 ---
int(0)
--- testing: 4294967295 % -1 ---
@@ -228,7 +228,7 @@ int(1)
--- testing: 4294967295 % 9223372036854775807 ---
int(4294967295)
--- testing: 4294967293 % 0 ---
-Exception: Division by zero
+Exception: Modulo by zero
--- testing: 4294967293 % 1 ---
int(0)
--- testing: 4294967293 % -1 ---
@@ -246,7 +246,7 @@ int(2147483646)
--- testing: 4294967293 % 9223372036854775807 ---
int(4294967293)
--- testing: 9223372036854775806 % 0 ---
-Exception: Division by zero
+Exception: Modulo by zero
--- testing: 9223372036854775806 % 1 ---
int(0)
--- testing: 9223372036854775806 % -1 ---
@@ -264,7 +264,7 @@ int(0)
--- testing: 9223372036854775806 % 9223372036854775807 ---
int(9223372036854775806)
--- testing: 9.2233720368548E+18 % 0 ---
-Exception: Division by zero
+Exception: Modulo by zero
--- testing: 9.2233720368548E+18 % 1 ---
int(0)
--- testing: 9.2233720368548E+18 % -1 ---
@@ -282,7 +282,7 @@ int(-2)
--- testing: 9.2233720368548E+18 % 9223372036854775807 ---
int(-1)
--- testing: -9223372036854775807 % 0 ---
-Exception: Division by zero
+Exception: Modulo by zero
--- testing: -9223372036854775807 % 1 ---
int(0)
--- testing: -9223372036854775807 % -1 ---
@@ -300,7 +300,7 @@ int(-1)
--- testing: -9223372036854775807 % 9223372036854775807 ---
int(0)
--- testing: -9.2233720368548E+18 % 0 ---
-Exception: Division by zero
+Exception: Modulo by zero
--- testing: -9.2233720368548E+18 % 1 ---
int(0)
--- testing: -9.2233720368548E+18 % -1 ---
diff --git a/tests/lang/operators/modulus_variationStr.phpt b/tests/lang/operators/modulus_variationStr.phpt
index 24312b5611..49487000b3 100644
--- a/tests/lang/operators/modulus_variationStr.phpt
+++ b/tests/lang/operators/modulus_variationStr.phpt
@@ -15,7 +15,7 @@ foreach ($strVals as $strVal) {
echo "--- testing: '$strVal' % '$otherVal' ---\n";
try {
var_dump($strVal%$otherVal);
- } catch (Exception $e) {
+ } catch (Throwable $e) {
echo "Exception: " . $e->getMessage() . "\n";
}
}
@@ -25,396 +25,396 @@ foreach ($strVals as $strVal) {
?>
===DONE===
--EXPECT--
---- testing: '0' % '0' ---
-Exception: Division by zero
---- testing: '0' % '65' ---
-int(0)
---- testing: '0' % '-44' ---
-int(0)
---- testing: '0' % '1.2' ---
-int(0)
---- testing: '0' % '-7.7' ---
-int(0)
---- testing: '0' % 'abc' ---
-Exception: Division by zero
---- testing: '0' % '123abc' ---
-int(0)
---- testing: '0' % '123e5' ---
-int(0)
---- testing: '0' % '123e5xyz' ---
-int(0)
---- testing: '0' % ' 123abc' ---
-int(0)
---- testing: '0' % '123 abc' ---
-int(0)
---- testing: '0' % '123abc ' ---
-int(0)
---- testing: '0' % '3.4a' ---
-int(0)
---- testing: '0' % 'a5.9' ---
-Exception: Division by zero
---- testing: '65' % '0' ---
-Exception: Division by zero
---- testing: '65' % '65' ---
-int(0)
---- testing: '65' % '-44' ---
-int(21)
---- testing: '65' % '1.2' ---
-int(0)
---- testing: '65' % '-7.7' ---
-int(2)
---- testing: '65' % 'abc' ---
-Exception: Division by zero
---- testing: '65' % '123abc' ---
-int(65)
---- testing: '65' % '123e5' ---
-int(65)
---- testing: '65' % '123e5xyz' ---
-int(65)
---- testing: '65' % ' 123abc' ---
-int(65)
---- testing: '65' % '123 abc' ---
-int(65)
---- testing: '65' % '123abc ' ---
-int(65)
---- testing: '65' % '3.4a' ---
-int(2)
---- testing: '65' % 'a5.9' ---
-Exception: Division by zero
---- testing: '-44' % '0' ---
-Exception: Division by zero
---- testing: '-44' % '65' ---
-int(-44)
---- testing: '-44' % '-44' ---
-int(0)
---- testing: '-44' % '1.2' ---
-int(0)
---- testing: '-44' % '-7.7' ---
-int(-2)
---- testing: '-44' % 'abc' ---
-Exception: Division by zero
---- testing: '-44' % '123abc' ---
-int(-44)
---- testing: '-44' % '123e5' ---
-int(-44)
---- testing: '-44' % '123e5xyz' ---
-int(-44)
---- testing: '-44' % ' 123abc' ---
-int(-44)
---- testing: '-44' % '123 abc' ---
-int(-44)
---- testing: '-44' % '123abc ' ---
-int(-44)
---- testing: '-44' % '3.4a' ---
-int(-2)
---- testing: '-44' % 'a5.9' ---
-Exception: Division by zero
---- testing: '1.2' % '0' ---
-Exception: Division by zero
---- testing: '1.2' % '65' ---
-int(1)
---- testing: '1.2' % '-44' ---
-int(1)
---- testing: '1.2' % '1.2' ---
-int(0)
---- testing: '1.2' % '-7.7' ---
-int(1)
---- testing: '1.2' % 'abc' ---
-Exception: Division by zero
---- testing: '1.2' % '123abc' ---
-int(1)
---- testing: '1.2' % '123e5' ---
-int(1)
---- testing: '1.2' % '123e5xyz' ---
-int(1)
---- testing: '1.2' % ' 123abc' ---
-int(1)
---- testing: '1.2' % '123 abc' ---
-int(1)
---- testing: '1.2' % '123abc ' ---
-int(1)
---- testing: '1.2' % '3.4a' ---
-int(1)
---- testing: '1.2' % 'a5.9' ---
-Exception: Division by zero
---- testing: '-7.7' % '0' ---
-Exception: Division by zero
---- testing: '-7.7' % '65' ---
-int(-7)
---- testing: '-7.7' % '-44' ---
-int(-7)
---- testing: '-7.7' % '1.2' ---
-int(0)
---- testing: '-7.7' % '-7.7' ---
-int(0)
---- testing: '-7.7' % 'abc' ---
-Exception: Division by zero
---- testing: '-7.7' % '123abc' ---
-int(-7)
---- testing: '-7.7' % '123e5' ---
-int(-7)
---- testing: '-7.7' % '123e5xyz' ---
-int(-7)
---- testing: '-7.7' % ' 123abc' ---
-int(-7)
---- testing: '-7.7' % '123 abc' ---
-int(-7)
---- testing: '-7.7' % '123abc ' ---
-int(-7)
---- testing: '-7.7' % '3.4a' ---
-int(-1)
---- testing: '-7.7' % 'a5.9' ---
-Exception: Division by zero
---- testing: 'abc' % '0' ---
-Exception: Division by zero
---- testing: 'abc' % '65' ---
-int(0)
---- testing: 'abc' % '-44' ---
-int(0)
---- testing: 'abc' % '1.2' ---
-int(0)
---- testing: 'abc' % '-7.7' ---
-int(0)
---- testing: 'abc' % 'abc' ---
-Exception: Division by zero
---- testing: 'abc' % '123abc' ---
-int(0)
---- testing: 'abc' % '123e5' ---
-int(0)
---- testing: 'abc' % '123e5xyz' ---
-int(0)
---- testing: 'abc' % ' 123abc' ---
-int(0)
---- testing: 'abc' % '123 abc' ---
-int(0)
---- testing: 'abc' % '123abc ' ---
-int(0)
---- testing: 'abc' % '3.4a' ---
-int(0)
---- testing: 'abc' % 'a5.9' ---
-Exception: Division by zero
---- testing: '123abc' % '0' ---
-Exception: Division by zero
---- testing: '123abc' % '65' ---
-int(58)
---- testing: '123abc' % '-44' ---
-int(35)
---- testing: '123abc' % '1.2' ---
-int(0)
---- testing: '123abc' % '-7.7' ---
-int(4)
---- testing: '123abc' % 'abc' ---
-Exception: Division by zero
---- testing: '123abc' % '123abc' ---
-int(0)
---- testing: '123abc' % '123e5' ---
-int(0)
---- testing: '123abc' % '123e5xyz' ---
-int(0)
---- testing: '123abc' % ' 123abc' ---
-int(0)
---- testing: '123abc' % '123 abc' ---
-int(0)
---- testing: '123abc' % '123abc ' ---
-int(0)
---- testing: '123abc' % '3.4a' ---
-int(0)
---- testing: '123abc' % 'a5.9' ---
-Exception: Division by zero
---- testing: '123e5' % '0' ---
-Exception: Division by zero
---- testing: '123e5' % '65' ---
-int(58)
---- testing: '123e5' % '-44' ---
-int(35)
---- testing: '123e5' % '1.2' ---
-int(0)
---- testing: '123e5' % '-7.7' ---
-int(4)
---- testing: '123e5' % 'abc' ---
-Exception: Division by zero
---- testing: '123e5' % '123abc' ---
-int(0)
---- testing: '123e5' % '123e5' ---
-int(0)
---- testing: '123e5' % '123e5xyz' ---
-int(0)
---- testing: '123e5' % ' 123abc' ---
-int(0)
---- testing: '123e5' % '123 abc' ---
-int(0)
---- testing: '123e5' % '123abc ' ---
-int(0)
---- testing: '123e5' % '3.4a' ---
-int(0)
---- testing: '123e5' % 'a5.9' ---
-Exception: Division by zero
---- testing: '123e5xyz' % '0' ---
-Exception: Division by zero
---- testing: '123e5xyz' % '65' ---
-int(58)
---- testing: '123e5xyz' % '-44' ---
-int(35)
---- testing: '123e5xyz' % '1.2' ---
-int(0)
---- testing: '123e5xyz' % '-7.7' ---
-int(4)
---- testing: '123e5xyz' % 'abc' ---
-Exception: Division by zero
---- testing: '123e5xyz' % '123abc' ---
-int(0)
---- testing: '123e5xyz' % '123e5' ---
-int(0)
---- testing: '123e5xyz' % '123e5xyz' ---
-int(0)
---- testing: '123e5xyz' % ' 123abc' ---
-int(0)
---- testing: '123e5xyz' % '123 abc' ---
-int(0)
---- testing: '123e5xyz' % '123abc ' ---
-int(0)
---- testing: '123e5xyz' % '3.4a' ---
-int(0)
---- testing: '123e5xyz' % 'a5.9' ---
-Exception: Division by zero
---- testing: ' 123abc' % '0' ---
-Exception: Division by zero
---- testing: ' 123abc' % '65' ---
-int(58)
---- testing: ' 123abc' % '-44' ---
-int(35)
---- testing: ' 123abc' % '1.2' ---
-int(0)
---- testing: ' 123abc' % '-7.7' ---
-int(4)
---- testing: ' 123abc' % 'abc' ---
-Exception: Division by zero
---- testing: ' 123abc' % '123abc' ---
-int(0)
---- testing: ' 123abc' % '123e5' ---
-int(0)
---- testing: ' 123abc' % '123e5xyz' ---
-int(0)
---- testing: ' 123abc' % ' 123abc' ---
-int(0)
---- testing: ' 123abc' % '123 abc' ---
-int(0)
---- testing: ' 123abc' % '123abc ' ---
-int(0)
---- testing: ' 123abc' % '3.4a' ---
-int(0)
---- testing: ' 123abc' % 'a5.9' ---
-Exception: Division by zero
---- testing: '123 abc' % '0' ---
-Exception: Division by zero
---- testing: '123 abc' % '65' ---
-int(58)
---- testing: '123 abc' % '-44' ---
-int(35)
---- testing: '123 abc' % '1.2' ---
-int(0)
---- testing: '123 abc' % '-7.7' ---
-int(4)
---- testing: '123 abc' % 'abc' ---
-Exception: Division by zero
---- testing: '123 abc' % '123abc' ---
-int(0)
---- testing: '123 abc' % '123e5' ---
-int(0)
---- testing: '123 abc' % '123e5xyz' ---
-int(0)
---- testing: '123 abc' % ' 123abc' ---
-int(0)
---- testing: '123 abc' % '123 abc' ---
-int(0)
---- testing: '123 abc' % '123abc ' ---
-int(0)
---- testing: '123 abc' % '3.4a' ---
-int(0)
---- testing: '123 abc' % 'a5.9' ---
-Exception: Division by zero
---- testing: '123abc ' % '0' ---
-Exception: Division by zero
---- testing: '123abc ' % '65' ---
-int(58)
---- testing: '123abc ' % '-44' ---
-int(35)
---- testing: '123abc ' % '1.2' ---
-int(0)
---- testing: '123abc ' % '-7.7' ---
-int(4)
---- testing: '123abc ' % 'abc' ---
-Exception: Division by zero
---- testing: '123abc ' % '123abc' ---
-int(0)
---- testing: '123abc ' % '123e5' ---
-int(0)
---- testing: '123abc ' % '123e5xyz' ---
-int(0)
---- testing: '123abc ' % ' 123abc' ---
-int(0)
---- testing: '123abc ' % '123 abc' ---
-int(0)
---- testing: '123abc ' % '123abc ' ---
-int(0)
---- testing: '123abc ' % '3.4a' ---
-int(0)
---- testing: '123abc ' % 'a5.9' ---
-Exception: Division by zero
---- testing: '3.4a' % '0' ---
-Exception: Division by zero
---- testing: '3.4a' % '65' ---
-int(3)
---- testing: '3.4a' % '-44' ---
-int(3)
---- testing: '3.4a' % '1.2' ---
-int(0)
---- testing: '3.4a' % '-7.7' ---
-int(3)
---- testing: '3.4a' % 'abc' ---
-Exception: Division by zero
---- testing: '3.4a' % '123abc' ---
-int(3)
---- testing: '3.4a' % '123e5' ---
-int(3)
---- testing: '3.4a' % '123e5xyz' ---
-int(3)
---- testing: '3.4a' % ' 123abc' ---
-int(3)
---- testing: '3.4a' % '123 abc' ---
-int(3)
---- testing: '3.4a' % '123abc ' ---
-int(3)
---- testing: '3.4a' % '3.4a' ---
-int(0)
---- testing: '3.4a' % 'a5.9' ---
-Exception: Division by zero
---- testing: 'a5.9' % '0' ---
-Exception: Division by zero
---- testing: 'a5.9' % '65' ---
-int(0)
---- testing: 'a5.9' % '-44' ---
-int(0)
---- testing: 'a5.9' % '1.2' ---
-int(0)
---- testing: 'a5.9' % '-7.7' ---
-int(0)
---- testing: 'a5.9' % 'abc' ---
-Exception: Division by zero
---- testing: 'a5.9' % '123abc' ---
-int(0)
---- testing: 'a5.9' % '123e5' ---
-int(0)
---- testing: 'a5.9' % '123e5xyz' ---
-int(0)
---- testing: 'a5.9' % ' 123abc' ---
-int(0)
---- testing: 'a5.9' % '123 abc' ---
-int(0)
---- testing: 'a5.9' % '123abc ' ---
-int(0)
---- testing: 'a5.9' % '3.4a' ---
-int(0)
---- testing: 'a5.9' % 'a5.9' ---
-Exception: Division by zero
+--- testing: '0' % '0' ---
+Exception: Modulo by zero
+--- testing: '0' % '65' ---
+int(0)
+--- testing: '0' % '-44' ---
+int(0)
+--- testing: '0' % '1.2' ---
+int(0)
+--- testing: '0' % '-7.7' ---
+int(0)
+--- testing: '0' % 'abc' ---
+Exception: Modulo by zero
+--- testing: '0' % '123abc' ---
+int(0)
+--- testing: '0' % '123e5' ---
+int(0)
+--- testing: '0' % '123e5xyz' ---
+int(0)
+--- testing: '0' % ' 123abc' ---
+int(0)
+--- testing: '0' % '123 abc' ---
+int(0)
+--- testing: '0' % '123abc ' ---
+int(0)
+--- testing: '0' % '3.4a' ---
+int(0)
+--- testing: '0' % 'a5.9' ---
+Exception: Modulo by zero
+--- testing: '65' % '0' ---
+Exception: Modulo by zero
+--- testing: '65' % '65' ---
+int(0)
+--- testing: '65' % '-44' ---
+int(21)
+--- testing: '65' % '1.2' ---
+int(0)
+--- testing: '65' % '-7.7' ---
+int(2)
+--- testing: '65' % 'abc' ---
+Exception: Modulo by zero
+--- testing: '65' % '123abc' ---
+int(65)
+--- testing: '65' % '123e5' ---
+int(65)
+--- testing: '65' % '123e5xyz' ---
+int(65)
+--- testing: '65' % ' 123abc' ---
+int(65)
+--- testing: '65' % '123 abc' ---
+int(65)
+--- testing: '65' % '123abc ' ---
+int(65)
+--- testing: '65' % '3.4a' ---
+int(2)
+--- testing: '65' % 'a5.9' ---
+Exception: Modulo by zero
+--- testing: '-44' % '0' ---
+Exception: Modulo by zero
+--- testing: '-44' % '65' ---
+int(-44)
+--- testing: '-44' % '-44' ---
+int(0)
+--- testing: '-44' % '1.2' ---
+int(0)
+--- testing: '-44' % '-7.7' ---
+int(-2)
+--- testing: '-44' % 'abc' ---
+Exception: Modulo by zero
+--- testing: '-44' % '123abc' ---
+int(-44)
+--- testing: '-44' % '123e5' ---
+int(-44)
+--- testing: '-44' % '123e5xyz' ---
+int(-44)
+--- testing: '-44' % ' 123abc' ---
+int(-44)
+--- testing: '-44' % '123 abc' ---
+int(-44)
+--- testing: '-44' % '123abc ' ---
+int(-44)
+--- testing: '-44' % '3.4a' ---
+int(-2)
+--- testing: '-44' % 'a5.9' ---
+Exception: Modulo by zero
+--- testing: '1.2' % '0' ---
+Exception: Modulo by zero
+--- testing: '1.2' % '65' ---
+int(1)
+--- testing: '1.2' % '-44' ---
+int(1)
+--- testing: '1.2' % '1.2' ---
+int(0)
+--- testing: '1.2' % '-7.7' ---
+int(1)
+--- testing: '1.2' % 'abc' ---
+Exception: Modulo by zero
+--- testing: '1.2' % '123abc' ---
+int(1)
+--- testing: '1.2' % '123e5' ---
+int(1)
+--- testing: '1.2' % '123e5xyz' ---
+int(1)
+--- testing: '1.2' % ' 123abc' ---
+int(1)
+--- testing: '1.2' % '123 abc' ---
+int(1)
+--- testing: '1.2' % '123abc ' ---
+int(1)
+--- testing: '1.2' % '3.4a' ---
+int(1)
+--- testing: '1.2' % 'a5.9' ---
+Exception: Modulo by zero
+--- testing: '-7.7' % '0' ---
+Exception: Modulo by zero
+--- testing: '-7.7' % '65' ---
+int(-7)
+--- testing: '-7.7' % '-44' ---
+int(-7)
+--- testing: '-7.7' % '1.2' ---
+int(0)
+--- testing: '-7.7' % '-7.7' ---
+int(0)
+--- testing: '-7.7' % 'abc' ---
+Exception: Modulo by zero
+--- testing: '-7.7' % '123abc' ---
+int(-7)
+--- testing: '-7.7' % '123e5' ---
+int(-7)
+--- testing: '-7.7' % '123e5xyz' ---
+int(-7)
+--- testing: '-7.7' % ' 123abc' ---
+int(-7)
+--- testing: '-7.7' % '123 abc' ---
+int(-7)
+--- testing: '-7.7' % '123abc ' ---
+int(-7)
+--- testing: '-7.7' % '3.4a' ---
+int(-1)
+--- testing: '-7.7' % 'a5.9' ---
+Exception: Modulo by zero
+--- testing: 'abc' % '0' ---
+Exception: Modulo by zero
+--- testing: 'abc' % '65' ---
+int(0)
+--- testing: 'abc' % '-44' ---
+int(0)
+--- testing: 'abc' % '1.2' ---
+int(0)
+--- testing: 'abc' % '-7.7' ---
+int(0)
+--- testing: 'abc' % 'abc' ---
+Exception: Modulo by zero
+--- testing: 'abc' % '123abc' ---
+int(0)
+--- testing: 'abc' % '123e5' ---
+int(0)
+--- testing: 'abc' % '123e5xyz' ---
+int(0)
+--- testing: 'abc' % ' 123abc' ---
+int(0)
+--- testing: 'abc' % '123 abc' ---
+int(0)
+--- testing: 'abc' % '123abc ' ---
+int(0)
+--- testing: 'abc' % '3.4a' ---
+int(0)
+--- testing: 'abc' % 'a5.9' ---
+Exception: Modulo by zero
+--- testing: '123abc' % '0' ---
+Exception: Modulo by zero
+--- testing: '123abc' % '65' ---
+int(58)
+--- testing: '123abc' % '-44' ---
+int(35)
+--- testing: '123abc' % '1.2' ---
+int(0)
+--- testing: '123abc' % '-7.7' ---
+int(4)
+--- testing: '123abc' % 'abc' ---
+Exception: Modulo by zero
+--- testing: '123abc' % '123abc' ---
+int(0)
+--- testing: '123abc' % '123e5' ---
+int(0)
+--- testing: '123abc' % '123e5xyz' ---
+int(0)
+--- testing: '123abc' % ' 123abc' ---
+int(0)
+--- testing: '123abc' % '123 abc' ---
+int(0)
+--- testing: '123abc' % '123abc ' ---
+int(0)
+--- testing: '123abc' % '3.4a' ---
+int(0)
+--- testing: '123abc' % 'a5.9' ---
+Exception: Modulo by zero
+--- testing: '123e5' % '0' ---
+Exception: Modulo by zero
+--- testing: '123e5' % '65' ---
+int(58)
+--- testing: '123e5' % '-44' ---
+int(35)
+--- testing: '123e5' % '1.2' ---
+int(0)
+--- testing: '123e5' % '-7.7' ---
+int(4)
+--- testing: '123e5' % 'abc' ---
+Exception: Modulo by zero
+--- testing: '123e5' % '123abc' ---
+int(0)
+--- testing: '123e5' % '123e5' ---
+int(0)
+--- testing: '123e5' % '123e5xyz' ---
+int(0)
+--- testing: '123e5' % ' 123abc' ---
+int(0)
+--- testing: '123e5' % '123 abc' ---
+int(0)
+--- testing: '123e5' % '123abc ' ---
+int(0)
+--- testing: '123e5' % '3.4a' ---
+int(0)
+--- testing: '123e5' % 'a5.9' ---
+Exception: Modulo by zero
+--- testing: '123e5xyz' % '0' ---
+Exception: Modulo by zero
+--- testing: '123e5xyz' % '65' ---
+int(58)
+--- testing: '123e5xyz' % '-44' ---
+int(35)
+--- testing: '123e5xyz' % '1.2' ---
+int(0)
+--- testing: '123e5xyz' % '-7.7' ---
+int(4)
+--- testing: '123e5xyz' % 'abc' ---
+Exception: Modulo by zero
+--- testing: '123e5xyz' % '123abc' ---
+int(0)
+--- testing: '123e5xyz' % '123e5' ---
+int(0)
+--- testing: '123e5xyz' % '123e5xyz' ---
+int(0)
+--- testing: '123e5xyz' % ' 123abc' ---
+int(0)
+--- testing: '123e5xyz' % '123 abc' ---
+int(0)
+--- testing: '123e5xyz' % '123abc ' ---
+int(0)
+--- testing: '123e5xyz' % '3.4a' ---
+int(0)
+--- testing: '123e5xyz' % 'a5.9' ---
+Exception: Modulo by zero
+--- testing: ' 123abc' % '0' ---
+Exception: Modulo by zero
+--- testing: ' 123abc' % '65' ---
+int(58)
+--- testing: ' 123abc' % '-44' ---
+int(35)
+--- testing: ' 123abc' % '1.2' ---
+int(0)
+--- testing: ' 123abc' % '-7.7' ---
+int(4)
+--- testing: ' 123abc' % 'abc' ---
+Exception: Modulo by zero
+--- testing: ' 123abc' % '123abc' ---
+int(0)
+--- testing: ' 123abc' % '123e5' ---
+int(0)
+--- testing: ' 123abc' % '123e5xyz' ---
+int(0)
+--- testing: ' 123abc' % ' 123abc' ---
+int(0)
+--- testing: ' 123abc' % '123 abc' ---
+int(0)
+--- testing: ' 123abc' % '123abc ' ---
+int(0)
+--- testing: ' 123abc' % '3.4a' ---
+int(0)
+--- testing: ' 123abc' % 'a5.9' ---
+Exception: Modulo by zero
+--- testing: '123 abc' % '0' ---
+Exception: Modulo by zero
+--- testing: '123 abc' % '65' ---
+int(58)
+--- testing: '123 abc' % '-44' ---
+int(35)
+--- testing: '123 abc' % '1.2' ---
+int(0)
+--- testing: '123 abc' % '-7.7' ---
+int(4)
+--- testing: '123 abc' % 'abc' ---
+Exception: Modulo by zero
+--- testing: '123 abc' % '123abc' ---
+int(0)
+--- testing: '123 abc' % '123e5' ---
+int(0)
+--- testing: '123 abc' % '123e5xyz' ---
+int(0)
+--- testing: '123 abc' % ' 123abc' ---
+int(0)
+--- testing: '123 abc' % '123 abc' ---
+int(0)
+--- testing: '123 abc' % '123abc ' ---
+int(0)
+--- testing: '123 abc' % '3.4a' ---
+int(0)
+--- testing: '123 abc' % 'a5.9' ---
+Exception: Modulo by zero
+--- testing: '123abc ' % '0' ---
+Exception: Modulo by zero
+--- testing: '123abc ' % '65' ---
+int(58)
+--- testing: '123abc ' % '-44' ---
+int(35)
+--- testing: '123abc ' % '1.2' ---
+int(0)
+--- testing: '123abc ' % '-7.7' ---
+int(4)
+--- testing: '123abc ' % 'abc' ---
+Exception: Modulo by zero
+--- testing: '123abc ' % '123abc' ---
+int(0)
+--- testing: '123abc ' % '123e5' ---
+int(0)
+--- testing: '123abc ' % '123e5xyz' ---
+int(0)
+--- testing: '123abc ' % ' 123abc' ---
+int(0)
+--- testing: '123abc ' % '123 abc' ---
+int(0)
+--- testing: '123abc ' % '123abc ' ---
+int(0)
+--- testing: '123abc ' % '3.4a' ---
+int(0)
+--- testing: '123abc ' % 'a5.9' ---
+Exception: Modulo by zero
+--- testing: '3.4a' % '0' ---
+Exception: Modulo by zero
+--- testing: '3.4a' % '65' ---
+int(3)
+--- testing: '3.4a' % '-44' ---
+int(3)
+--- testing: '3.4a' % '1.2' ---
+int(0)
+--- testing: '3.4a' % '-7.7' ---
+int(3)
+--- testing: '3.4a' % 'abc' ---
+Exception: Modulo by zero
+--- testing: '3.4a' % '123abc' ---
+int(3)
+--- testing: '3.4a' % '123e5' ---
+int(3)
+--- testing: '3.4a' % '123e5xyz' ---
+int(3)
+--- testing: '3.4a' % ' 123abc' ---
+int(3)
+--- testing: '3.4a' % '123 abc' ---
+int(3)
+--- testing: '3.4a' % '123abc ' ---
+int(3)
+--- testing: '3.4a' % '3.4a' ---
+int(0)
+--- testing: '3.4a' % 'a5.9' ---
+Exception: Modulo by zero
+--- testing: 'a5.9' % '0' ---
+Exception: Modulo by zero
+--- testing: 'a5.9' % '65' ---
+int(0)
+--- testing: 'a5.9' % '-44' ---
+int(0)
+--- testing: 'a5.9' % '1.2' ---
+int(0)
+--- testing: 'a5.9' % '-7.7' ---
+int(0)
+--- testing: 'a5.9' % 'abc' ---
+Exception: Modulo by zero
+--- testing: 'a5.9' % '123abc' ---
+int(0)
+--- testing: 'a5.9' % '123e5' ---
+int(0)
+--- testing: 'a5.9' % '123e5xyz' ---
+int(0)
+--- testing: 'a5.9' % ' 123abc' ---
+int(0)
+--- testing: 'a5.9' % '123 abc' ---
+int(0)
+--- testing: 'a5.9' % '123abc ' ---
+int(0)
+--- testing: 'a5.9' % '3.4a' ---
+int(0)
+--- testing: 'a5.9' % 'a5.9' ---
+Exception: Modulo by zero
===DONE===