Skip to content

Commit

Permalink
Merge pull request #1567 from sjinks/issue-1566
Browse files Browse the repository at this point in the history
Implement zephir_{greater,less}_double()
  • Loading branch information
sergeyklay authored Aug 2, 2017
2 parents 0161027 + 7dbf999 commit 534bd28
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions kernels/ZendEngine3/operators.c
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,15 @@ int zephir_less_long(zval *op1, long op2)
return Z_TYPE(result) == IS_TRUE;
}

int zephir_less_double(zval *op1, double op2)
{
zval result, op2_zval;
ZVAL_DOUBLE(&op2_zval, op2);

is_smaller_function(&result, op1, &op2_zval);
return Z_TYPE(result) == IS_TRUE;
}

int zephir_less_equal_long(zval *op1, long op2)
{
zval result, op2_zval;
Expand All @@ -549,6 +558,15 @@ int zephir_greater_long(zval *op1, long op2)
return Z_TYPE(result) == IS_FALSE;
}

int zephir_greater_double(zval *op1, double op2)
{
zval result, op2_zval;
ZVAL_DOUBLE(&op2_zval, op2);

is_smaller_or_equal_function(&result, op1, &op2_zval);
return Z_TYPE(result) == IS_FALSE;
}

/**
* Check if a zval is greater/equal than other
*/
Expand Down

0 comments on commit 534bd28

Please sign in to comment.