8000 replaced fabs by platform-agnostic version · adafruit/circuitpython-ulab@1df50af · GitHub
[go: up one dir, main page]

Skip to content

Commit 1df50af

Browse files
committed
replaced fabs by platform-agnostic version
2 parents 1b9a80a + 97e98c4 commit 1df50af

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

code/ndarray.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ mp_obj_t ndarray_iternext(mp_obj_t self_in) {
580580
ndarray_obj_t *ndarray = MP_OBJ_TO_PTR(self->ndarray);
581581
// TODO: in numpy, ndarrays are iterated with respect to the first axis.
582582
size_t iter_end = 0;
583-
if((ndarray->m == 1)) {
583+
if(ndarray->m == 1) {
584584
iter_end = ndarray->array->len;
585585
} else {
586586
iter_end = ndarray->m;
@@ -888,12 +888,12 @@ mp_obj_t ndarray_unary_op(mp_unary_op_t op, mp_obj_t self_in) {
888888
return ndarray_copy(self_in);
889889
}
890890
ndarray = MP_OBJ_TO_PTR(ndarray_copy(self_in));
891-
if((self->array->typecode == NDARRAY_INT8)) {
891+
if(self->array->typecode == NDARRAY_INT8) {
892892
int8_t *array = (int8_t *)ndarray->array->items;
893893
for(size_t i=0; i < self->array->len; i++) {
894894
if(array[i] < 0) array[i] = -array[i];
895895
}
896-
} else if((self->array->typecode == NDARRAY_INT16)) {
896+
} else if(self->array->typecode == NDARRAY_INT16) {
897897
int16_t *array = (int16_t *)ndarray->array->items;
898898
for(size_t i=0; i < self->array->len; i++) {
899899
if(array[i] < 0) array[i] = -array[i];

code/poly.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ mp_obj_t poly_polyfit(size_t n_args, const mp_obj_t *args) {
8989
if(!object_is_nditerable(args[0])) {
9090
mp_raise_ValueError("input data must be an iterable");
9191
}
92-
uint16_t lenx, leny;
93-
uint8_t deg;
92+
uint16_t lenx = 0, leny = 0;
93+
uint8_t deg = 0;
9494
mp_float_t *x, *XT, *y, *prod;
9595

9696
if(n_args == 2) { // only the y values are supplied

docs/ulab.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5116,11 +5116,11 @@
51165116
},
51175117
{
51185118
"cell_type": "code",
5119-
"execution_count": 504,
5119+
"execution_count": 507,
51205120
"metadata": {
51215121
"ExecuteTime": {
5122-
"end_time": "2019-11-14T19:23:36.725005Z",
5123-
"start_time": "2019-11-14T19:23:36.718109Z"
5122+
"end_time": "2019-11-14T19:27:23.050475Z",
5123+
"start_time": "2019-11-14T19:27:23.043203Z"
51245124
},
51255125
"code_folding": []
51265126
},

0 commit comments

Comments
 (0)
0