@@ -47,7 +47,7 @@ extern const mp_obj_float_t mp_math_pi_obj;
4747
4848/// \function phase(z)
4949/// Returns the phase of the number `z`, in the range (-pi, +pi].
50- mp_obj_t mp_cmath_phase (mp_obj_t z_obj ) {
50+ STATIC mp_obj_t mp_cmath_phase (mp_obj_t z_obj ) {
5151 mp_float_t real , imag ;
5252 mp_obj_get_complex (z_obj , & real , & imag );
5353 return mp_obj_new_float (MICROPY_FLOAT_C_FUN (atan2 )(imag , real ));
@@ -56,7 +56,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(mp_cmath_phase_obj, mp_cmath_phase);
5656
5757/// \function polar(z)
5858/// Returns, as a tuple, the polar form of `z`.
59- mp_obj_t mp_cmath_polar (mp_obj_t z_obj ) {
59+ STATIC mp_obj_t mp_cmath_polar (mp_obj_t z_obj ) {
6060 mp_float_t real , imag ;
6161 mp_obj_get_complex (z_obj , & real , & imag );
6262 mp_obj_t tuple [2 ] = {
@@ -69,7 +69,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(mp_cmath_polar_obj, mp_cmath_polar);
6969
7070/// \function rect(r, phi)
7171/// Returns the complex number with modulus `r` and phase `phi`.
72- mp_obj_t mp_cmath_rect (mp_obj_t r_obj , mp_obj_t phi_obj ) {
72+ STATIC mp_obj_t mp_cmath_rect (mp_obj_t r_obj , mp_obj_t phi_obj ) {
7373 mp_float_t r = mp_obj_get_float (r_obj );
7474 mp_float_t phi = mp_obj_get_float (phi_obj );
7575 return mp_obj_new_complex (r * MICROPY_FLOAT_C_FUN (cos )(phi ), r * MICROPY_FLOAT_C_FUN (sin )(phi ));
@@ -78,7 +78,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(mp_cmath_rect_obj, mp_cmath_rect);
7878
7979/// \function exp(z)
8080/// Return the exponential of `z`.
81- mp_obj_t mp_cmath_exp (mp_obj_t z_obj ) {
81+ STATIC mp_obj_t mp_cmath_exp (mp_obj_t z_obj ) {
8282 mp_float_t real , imag ;
8383 mp_obj_get_complex (z_obj , & real , & imag );
8484 mp_float_t exp_real = MICROPY_FLOAT_C_FUN (exp )(real );
@@ -89,7 +89,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(mp_cmath_exp_obj, mp_cmath_exp);
8989/// \function log(z)
9090/// Return the natural logarithm of `z`. The branch cut is along the negative real axis.
9191// TODO can take second argument, being the base
92- mp_obj_t mp_cmath_log (mp_obj_t z_obj ) {
92+ STATIC mp_obj_t mp_cmath_log (mp_obj_t z_obj ) {
9393 mp_float_t real , imag ;
9494 mp_obj_get_complex (z_obj , & real , & imag );
9595 return mp_obj_new_complex (0.5 * MICROPY_FLOAT_C_FUN (log )(real * real + imag * imag ), MICROPY_FLOAT_C_FUN (atan2 )(imag , real ));
@@ -98,7 +98,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(mp_cmath_log_obj, mp_cmath_log);
9898
9999/// \function log10(z)
100100/// Return the base-10 logarithm of `z`. The branch cut is along the negative real axis.
101- mp_obj_t mp_cmath_log10 (mp_obj_t z_obj ) {
101+ STATIC mp_obj_t mp_cmath_log10 (mp_obj_t z_obj ) {
102102 mp_float_t real , imag ;
103103 mp_obj_get_complex (z_obj , & real , & imag );
104104 return mp_obj_new_complex (0.5 * MICROPY_FLOAT_C_FUN (log10 )(real * real + imag * imag ), MICROPY_FLOAT_C_FUN (atan2 )(imag , real ));
@@ -107,7 +107,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(mp_cmath_log10_obj, mp_cmath_log10);
107107
108108/// \function sqrt(z)
109109/// Return the square-root of `z`.
110- mp_obj_t mp_cmath_sqrt (mp_obj_t z_obj ) {
110+ STATIC mp_obj_t mp_cmath_sqrt (mp_obj_t z_obj ) {
111111 mp_float_t real , imag ;
112112 mp_obj_get_complex (z_obj , & real , & imag );
113113 mp_float_t sqrt_abs = MICROPY_FLOAT_C_FUN (pow )(real * real + imag * imag , 0.25 );
@@ -118,7 +118,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(mp_cmath_sqrt_obj, mp_cmath_sqrt);
118118
119119/// \function cos(z)
120120/// Return the cosine of `z`.
121- mp_obj_t mp_cmath_cos (mp_obj_t z_obj ) {
121+ STATIC mp_obj_t mp_cmath_cos (mp_obj_t z_obj ) {
122122 mp_float_t real , imag ;
123123 mp_obj_get_complex (z_obj , & real , & imag );
124124 return mp_obj_new_complex (MICROPY_FLOAT_C_FUN (cos )(real ) * MICROPY_FLOAT_C_FUN (cosh )(imag ), - MICROPY_FLOAT_C_FUN (sin )(real ) * MICROPY_FLOAT_C_FUN (sinh )(imag ));
@@ -127,7 +127,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(mp_cmath_cos_obj, mp_cmath_cos);
127127
128128/// \function sin(z)
129129/// Return the sine of `z`.
130- mp_obj_t mp_cmath_sin (mp_obj_t z_obj ) {
130+ STATIC mp_obj_t mp_cmath_sin (mp_obj_t z_obj ) {
131131 mp_float_t real , imag ;
132132 mp_obj_get_complex (z_obj , & real , & imag );
133133 return mp_obj_new_complex (MICROPY_FLOAT_C_FUN (sin )(real ) * MICROPY_FLOAT_C_FUN (cosh )(imag ), MICROPY_FLOAT_C_FUN (cos )(real ) * MICROPY_FLOAT_C_FUN (sinh )(imag ));
0 commit comments