Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix how arctan2 treats scalars
  • Loading branch information
v923z committed Aug 4, 2022
commit 5277ceb6ef3e5eb4ccae4a061267a3e642efd388
7 changes: 7 additions & 0 deletions code/numpy/vector.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,13 @@ MP_DEFINE_CONST_FUN_OBJ_1(vector_atan_obj, vector_atan);
//|

mp_obj_t vector_arctan2(mp_obj_t y, mp_obj_t x) {
if((mp_obj_is_float(y) || mp_obj_is_int(y)) &&
(mp_obj_is_float(x) || mp_obj_is_int(x))) {
mp_float_t _y = mp_obj_get_float(y);
mp_float_t _x = mp_obj_get_float(x);
return mp_obj_new_float(MICROPY_FLOAT_C_FUN(atan2)(_y, _x));
}

ndarray_obj_t *ndarray_x = ndarray_from_mp_obj(x, 0);
COMPLEX_DTYPE_NOT_IMPLEMENTED(ndarray_x->dtype)

Expand Down
2 changes: 1 addition & 1 deletion code/ulab.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include "user/user.h"
#include "utils/utils.h"

#define ULAB_VERSION 5.1.0
#define ULAB_VERSION 5.1.1
#define xstr(s) str(s)
#define str(s) #s

Expand Down
6 changes: 6 additions & 0 deletions docs/ulab-change-log.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Thu, 4 Aug 2022

version 5.1.1

fix how arctan2 treats scalars

Mon, 25 July 2022

version 5.1.0
Expand Down