Skip to content

Commit

Permalink
[bug fix]: inequality operators not working properly
Browse files Browse the repository at this point in the history
  • Loading branch information
erstan committed Aug 31, 2021
1 parent d35cdea commit c737c89
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions core/functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ double ceval_deg2rad(double x) {
return x / 180 * CEVAL_PI;
}
double ceval_int_part(double x) {
double x_i, x_f;
x_f = modf(x, & x_i);
double x_i;
modf(x, & x_i);
return x_i;
}
double ceval_frac_part(double x) {
Expand Down Expand Up @@ -417,28 +417,28 @@ double ceval_lesser(double a, double b, int arg_check) {
ceval_error("<=: function takes two arguments");
return NAN;
}
return (b - a) >= CEVAL_EPSILON;
return !ceval_greater_s(a, b, 0);
}
double ceval_greater(double a, double b, int arg_check) {
if (arg_check) {
ceval_error(">=: function takes two arguments");
return NAN;
}
return (a - b) >= CEVAL_EPSILON;
return !ceval_lesser_s(a, b, 0);
}
double ceval_lesser_s(double a, double b, int arg_check) {
if (arg_check) {
ceval_error("<: function takes two arguments");
return NAN;
}
return !ceval_greater(a, b, 0);
return (b - a) >= CEVAL_EPSILON;
}
double ceval_greater_s(double a, double b, int arg_check) {
if (arg_check) {
ceval_error(">: function takes two arguments");
return NAN;
}
return !ceval_lesser(a, b, 0);
return (a - b) >= CEVAL_EPSILON;
}
double ceval_comma(double x, double y, int arg_check) {
if (arg_check) {
Expand Down

0 comments on commit c737c89

Please sign in to comment.