summaryrefslogtreecommitdiff
path: root/py/modmath.c
diff options
context:
space:
mode:
authorDan Halbert <halbert@halwitz.org>2018-08-09 20:00:18 -0400
committerGitHub <noreply@github.com>2018-08-09 20:00:18 -0400
commitbbc034cd3dfc46ee7938faedc915fec91610c6a3 (patch)
tree4fe11d359088e41790030fce0763471b76ab3fb4 /py/modmath.c
parentb735b9dbed2132f07793324a40770f4bd96d9ae8 (diff)
parent24e53ad5911f42efb6508b4a8dcf4a196a81494a (diff)
Merge pull request #1104 from tannewt/more_strings
Fixes and translate more strings.
Diffstat (limited to 'py/modmath.c')
-rw-r--r--py/modmath.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/py/modmath.c b/py/modmath.c
index 4fa36d304..9d75ea2d5 100644
--- a/py/modmath.c
+++ b/py/modmath.c
@@ -27,6 +27,8 @@
#include "py/builtin.h"
#include "py/runtime.h"
+#include "supervisor/shared/translate.h"
+
#if MICROPY_PY_BUILTINS_FLOAT && MICROPY_PY_MATH
#include <math.h>
@@ -36,7 +38,7 @@
#define MP_PI MICROPY_FLOAT_CONST(3.14159265358979323846)
STATIC NORETURN void math_error(void) {
- mp_raise_ValueError("math domain error");
+ mp_raise_ValueError(translate("math domain error"));
}
STATIC mp_obj_t math_generic_1(mp_obj_t x_obj, mp_float_t (*f)(mp_float_t)) {
@@ -191,7 +193,7 @@ STATIC mp_obj_t mp_math_log(size_t n_args, const mp_obj_t *args) {
#pragma GCC diagnostic ignored "-Wfloat-equal"
} else if (base == (mp_float_t)1.0) {
#pragma GCC diagnostic pop
- mp_raise_msg(&mp_type_ZeroDivisionError, "division by zero");
+ mp_raise_msg(&mp_type_ZeroDivisionError, translate("division by zero"));
}
return mp_obj_new_float(l / MICROPY_FLOAT_C_FUN(log)(base));
}