summaryrefslogtreecommitdiffstatshomepage
path: root/py/builtin.c
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-06-20 01:48:35 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-06-20 18:00:23 +0300
commit3b6f7b95eb487fc927a3bc4644b1941cfbe2612b (patch)
treee06661e63e4c8bd6f94494281237bc31f4d488eb /py/builtin.c
parent7efbd325bb5ac540b746a594a76185c211963c46 (diff)
downloadmicropython-3b6f7b95eb487fc927a3bc4644b1941cfbe2612b.tar.gz
micropython-3b6f7b95eb487fc927a3bc4644b1941cfbe2612b.zip
py: Separate MICROPY_PY_BUILTINS_COMPLEX from MICROPY_PY_BUILTINS_FLOAT.
One thing is wanting to do 1 / 2 and get something else but 0, and quite another - doing rocket science ;-).
Diffstat (limited to 'py/builtin.c')
-rw-r--r--py/builtin.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/py/builtin.c b/py/builtin.c
index b25ca42a14..d4b77d37a8 100644
--- a/py/builtin.c
+++ b/py/builtin.c
@@ -113,11 +113,13 @@ mp_obj_t mp_builtin_abs(mp_obj_t o_in) {
} else {
return o_in;
}
+#if MICROPY_PY_BUILTINS_COMPLEX
} else if (MP_OBJ_IS_TYPE(o_in, &mp_type_complex)) {
mp_float_t real, imag;
mp_obj_complex_get(o_in, &real, &imag);
return mp_obj_new_float(MICROPY_FLOAT_C_FUN(sqrt)(real*real + imag*imag));
#endif
+#endif
} else {
assert(0);
return mp_const_none;