Skip to content

Commit aae73b3

Browse files
committed
COMMON: Fix ABSMIN/ABSMAX transposed #96
1 parent dce9be4 commit aae73b3

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

ChangeLog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2020-05-10 (0.12.19)
2+
Fix ABSMIN/ABSMAX transposed #96
3+
14
2020-05-09 (0.12.19)
25
COMMON: Fix crash when passing non-array to CHART
36
SDL: show icon in linux build

samples/distro-examples/tests/output/all.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ VIEW:
8383
WINDOW:
8484
WRITE:
8585
ABS:12.2222
86-
ABSMAX:1
87-
ABSMIN:9
86+
ABSMAX:9
87+
ABSMIN:1
8888
ACOS:nan
8989
ACOSH:3.2010898763691
9090
ACOT:0.0811223921009

src/common/blib_func.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,19 +122,20 @@ void dar_next(long funcCode, var_t *r, var_t *elem_p) {
122122
v_set(r, elem_p);
123123
}
124124
break;
125-
default: // numeric
125+
default:
126+
// numeric
126127
n = v_getval(elem_p);
127128

128129
switch (funcCode) {
129130
case kwABSMIN:
130131
n = fabsl(n);
131-
if (r->v.n < n) {
132+
if (n < r->v.n) {
132133
r->v.n = n;
133134
}
134135
break;
135136
case kwABSMAX:
136137
n = fabsl(n);
137-
if (r->v.n > n) {
138+
if (n > r->v.n) {
138139
r->v.n = n;
139140
}
140141
break;
@@ -145,8 +146,8 @@ void dar_next(long funcCode, var_t *r, var_t *elem_p) {
145146
case kwSUMSV:
146147
r->v.n += (n * n);
147148
break;
148-
} // sw2
149-
} // sw1
149+
}
150+
}
150151
}
151152

152153
/*

0 commit comments

Comments
 (0)