aboutsummaryrefslogtreecommitdiff
path: root/py/modcmath.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-02-02 12:52:14 +0000
committerDamien George <damien.p.george@gmail.com>2015-02-02 12:52:14 +0000
commitf49782f0058b0c7bdf21471a9265117089439124 (patch)
tree876590d937067ff4aab6ee348000abe3c8327d2c /py/modcmath.c
parent471b2a8906182616dee2f5be1bf6348b0ff56337 (diff)
py: Fix cmath.log10; fix printing of complex number with negative imag.
Diffstat (limited to 'py/modcmath.c')
-rw-r--r--py/modcmath.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/modcmath.c b/py/modcmath.c
index 59fa76ee6..46a33d3a8 100644
--- a/py/modcmath.c
+++ b/py/modcmath.c
@@ -97,7 +97,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(mp_cmath_log_obj, mp_cmath_log);
STATIC mp_obj_t mp_cmath_log10(mp_obj_t z_obj) {
mp_float_t real, imag;
mp_obj_get_complex(z_obj, &real, &imag);
- return mp_obj_new_complex(0.5 * MICROPY_FLOAT_C_FUN(log10)(real*real + imag*imag), MICROPY_FLOAT_C_FUN(atan2)(imag, real));
+ return mp_obj_new_complex(0.5 * MICROPY_FLOAT_C_FUN(log10)(real*real + imag*imag), 0.4342944819032518 * MICROPY_FLOAT_C_FUN(atan2)(imag, real));
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(mp_cmath_log10_obj, mp_cmath_log10);