Skip to content

Commit 7703d71

Browse files
committed
py, modcmath: Fix doc comment, and add some more of them.
1 parent 9749b2f commit 7703d71

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎py/modcmath.c‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ mp_obj_t mp_cmath_polar(mp_obj_t z_obj) {
6868
STATIC MP_DEFINE_CONST_FUN_OBJ_1(mp_cmath_polar_obj, mp_cmath_polar);
6969

7070
/// \function rect(r, phi)
71-
/// Returns the complex number with modules `r` and phase `phi`.
71+
/// Returns the complex number with modulus `r` and phase `phi`.
7272
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);
@@ -77,6 +77,7 @@ mp_obj_t mp_cmath_rect(mp_obj_t r_obj, mp_obj_t phi_obj) {
7777
STATIC MP_DEFINE_CONST_FUN_OBJ_2(mp_cmath_rect_obj, mp_cmath_rect);
7878

7979
/// \function exp(z)
80+
/// Return the exponential of `z`.
8081
mp_obj_t mp_cmath_exp(mp_obj_t z_obj) {
8182
mp_float_t real, imag;
8283
mp_obj_get_complex(z_obj, &real, &imag);
@@ -86,6 +87,7 @@ mp_obj_t mp_cmath_exp(mp_obj_t z_obj) {
8687
STATIC MP_DEFINE_CONST_FUN_OBJ_1(mp_cmath_exp_obj, mp_cmath_exp);
8788

8889
/// \function log(z)
90+
/// Return the natural logarithm of `z`. The branch cut is along the negative real axis.
8991
// TODO can take second argument, being the base
9092
mp_obj_t mp_cmath_log(mp_obj_t z_obj) {
9193
mp_float_t real, imag;
@@ -95,6 +97,7 @@ mp_obj_t mp_cmath_log(mp_obj_t z_obj) {
9597
STATIC MP_DEFINE_CONST_FUN_OBJ_1(mp_cmath_log_obj, mp_cmath_log);
9698

9799
/// \function log10(z)
100+
/// Return the base-10 logarithm of `z`. The branch cut is along the negative real axis.
98101
mp_obj_t mp_cmath_log10(mp_obj_t z_obj) {
99102
mp_float_t real, imag;
100103
mp_obj_get_complex(z_obj, &real, &imag);
@@ -103,6 +106,7 @@ mp_obj_t mp_cmath_log10(mp_obj_t z_obj) {
103106
STATIC MP_DEFINE_CONST_FUN_OBJ_1(mp_cmath_log10_obj, mp_cmath_log10);
104107

105108
/// \function sqrt(z)
109+
/// Return the square-root of `z`.
106110
mp_obj_t mp_cmath_sqrt(mp_obj_t z_obj) {
107111
mp_float_t real, imag;
108112
mp_obj_get_complex(z_obj, &real, &imag);
@@ -113,6 +117,7 @@ mp_obj_t mp_cmath_sqrt(mp_obj_t z_obj) {
113117
STATIC MP_DEFINE_CONST_FUN_OBJ_1(mp_cmath_sqrt_obj, mp_cmath_sqrt);
114118

115119
/// \function cos(z)
120+
/// Return the cosine of `z`.
116121
mp_obj_t mp_cmath_cos(mp_obj_t z_obj) {
117122
mp_float_t real, imag;
118123
mp_obj_get_complex(z_obj, &real, &imag);
@@ -121,6 +126,7 @@ mp_obj_t mp_cmath_cos(mp_obj_t z_obj) {
121126
STATIC MP_DEFINE_CONST_FUN_OBJ_1(mp_cmath_cos_obj, mp_cmath_cos);
122127

123128
/// \function sin(z)
129+
/// Return the sine of `z`.
124130
mp_obj_t mp_cmath_sin(mp_obj_t z_obj) {
125131
mp_float_t real, imag;
126132
mp_obj_get_complex(z_obj, &real, &imag);

0 commit comments

Comments
 (0)