math, rl: fix handing division involving negative numbers
commit9f60c73e33915139c850e5ef58c5f27a2750359a
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 5 Mar 2015 13:25:14 +0000 (5 16:25 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Thu, 5 Mar 2015 13:25:14 +0000 (5 16:25 +0300)
tree87ae8638a414a883b4c3852fe804eb86f70754b5
parent311fe8fe7863003f0a6c5979341fb91e508d09d1
math, rl: fix handing division involving negative numbers

I think more and more I want to move stuff from smatch_math.c into
smatch_ranges.c.

In the old system if the right hand side was negative we gave up.  To
figure out result we calculated "(min / max) to (max / min)".  This doesn't
work if we have negatives.

In the new system, we split the negatives and the positives from both sides
we do four division operations and then combine all the possible results.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch_math.c
smatch_ranges.c