Calc: remove default epsilon in + allow for scientific notation
This commit is contained in:
parent
85566d511c
commit
33f8c30bfc
|
@ -23,7 +23,7 @@ namespace {
|
|||
if (args.size() != 3)
|
||||
return 0;
|
||||
double test = args[0]->eval(vars, funs);
|
||||
if (std::fabs(test) < 1e-8)
|
||||
if (test == 0)
|
||||
return args[2]->eval(vars, funs);
|
||||
else
|
||||
return args[1]->eval(vars, funs);
|
||||
|
|
|
@ -11,6 +11,6 @@ DIVIDE = /
|
|||
EXPONENT = ^
|
||||
LT = <
|
||||
ASSIGN = =
|
||||
NUM = (0|[1-9][0-9]*)(\.[0-9]+)?
|
||||
NUM = (0|[1-9][0-9]*)(\.[0-9]+)?([eE]-?[0-9]+)?
|
||||
IDENT = [a-zA-Z_][a-zA-Z0-9_]*
|
||||
ignore = \n|\r| |\t
|
||||
|
|
Loading…
Reference in New Issue