8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bb8ba7f commit 93e51b5Copy full SHA for 93e51b5
py/modcmath.c
@@ -65,7 +65,7 @@ mp_obj_t mp_cmath_sqrt(mp_obj_t z_obj) {
65
mp_obj_get_complex(z_obj, &real, &imag);
66
mp_float_t sqrt_abs = MICROPY_FLOAT_C_FUN(pow)(real*real + imag*imag, 0.25);
67
mp_float_t theta = 0.5 * MICROPY_FLOAT_C_FUN(atan2)(imag, real);
68
- return mp_obj_new_complex(sqrt_abs * cos(theta), sqrt_abs * sin(theta));
+ return mp_obj_new_complex(sqrt_abs * MICROPY_FLOAT_C_FUN(cos)(theta), sqrt_abs * MICROPY_FLOAT_C_FUN(sin)(theta));
69
}
70
STATIC MP_DEFINE_CONST_FUN_OBJ_1(mp_cmath_sqrt_obj, mp_cmath_sqrt);
71
stmhal/mpconfigport.h
@@ -19,6 +19,7 @@
19
#define MICROPY_ENABLE_LFN (1)
20
#define MICROPY_LFN_CODE_PAGE (437) /* 1=SFN/ANSI 437=LFN/U.S.(OEM) */
21
#define MICROPY_MOD_SYS_STDFILES (1)
22
+#define MICROPY_ENABLE_MOD_CMATH (1)
23
24
// extra built in names to add to the global namespace
25
extern const struct _mp_obj_fun_native_t mp_builtin_help_obj;