Skip to content

Commit 0529073

Browse files
committed
expressions: Fix RISING() & FALLING() functions
1 parent 7f0866f commit 0529073

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/expr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ double _rising_callback(expr_t *expr, int argc, double *args) {
649649
double value = args[0];
650650
double result = 0;
651651

652-
if (value && !expr->value) {
652+
if (!IS_UNDEFINED(expr->value) && value > expr->value) {
653653
result = 1;
654654
}
655655

@@ -662,7 +662,7 @@ double _falling_callback(expr_t *expr, int argc, double *args) {
662662
double value = args[0];
663663
double result = 0;
664664

665-
if (!IS_UNDEFINED(expr->value) && !value && expr->value) {
665+
if (!IS_UNDEFINED(expr->value) && value < expr->value) {
666666
result = 1;
667667
}
668668

0 commit comments

Comments
 (0)