Summary:ASTERISK-09231: ast_expr2.y fails on negative real numbers
Reporter:Marcel Barbulescu (marcelbarbulescu)Labels:
Date Opened:2007-04-09 12:15:01Date Closed:2007-07-03 15:02:06
Versions:Frequency of
Environment:Attachments:( 0) Expr2-upgrade-Floats.patch
Description:if (-0.23 < 0) throws

ast_expr2.y:777 op_negate: non-numeric argument
Comments:By: Marcel Barbulescu (marcelbarbulescu) 2007-04-09 12:45:12

if (0.23 > 0) works just fine, so it parses floating point numbers, just not the negative ones.

By: Steve Murphy (murf) 2007-06-29 09:01:49

No, not really. It parses the 0.23 as a string, and does a strcmp between "0.23" and "0" and it wins sorta by accident.

I've got a "real" fix in the works right now. Finalized it last night. will merge it today.

By: Steve Murphy (murf) 2007-06-29 16:25:31

Someday soon, my license will be approved, and you'll be able to download
the attached patch file for trunk, and see how well it works for you.

Let me know ASAP, because I'll probably let it sit only a few days before I
commit it to trunk and close this bug.

By: Steve Murphy (murf) 2007-07-02 13:09:42

Hmmm, looks like license will be pending to Thurs. or later. I'm going to just put this in 1.4 and trunk, and let people moan and complain. Hopefully, there won't be a large amount of that...!

By: Steve Murphy (murf) 2007-07-02 16:34:31

Changes in 1.4 committed via 72933.
committed to trunk via 72940.

Please re-open this bug if any catastrophes occur!

By: Steve Murphy (murf) 2007-07-03 15:02:06

Due to outcry, reverted this patch to 1.4, in r. 73143. It's a trunk-only show now.