8000 On python3 log(0) raises math domain error, not zerodivisionerror · jepler/circuitpython@f67bca9 · GitHub
[go: up one dir, main page]

Skip to content

Commit f67bca9

Browse files
committed
On python3 log(0) raises math domain error, not zerodivisionerror
1 parent 0e19fbb commit f67bca9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

shared-bindings/math/__init__.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ STATIC mp_obj_t mp_math_log(size_t n_args, const mp_obj_t *args) {
371371
#pragma GCC diagnostic ignored "-Wfloat-equal"
372372
} else if (base == (mp_float_t)1.0) {
373373
#pragma GCC diagnostic pop
374-
mp_raise_msg(&mp_type_ZeroDivisionError, translate("division by zero"));
374+
math_error();
375375
}
376376
return mp_obj_new_float(l / MICROPY_FLOAT_C_FUN(log)(base));
377377
}

0 commit comments

Comments
 (0)
0