#143 closed defect (fixed)
Range Doesn`t work properly
Reported by: | asalafranca | Owned by: | manuelb |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | Math | Version: | head |
Severity: | blocker | Keywords: | |
Cc: |
Description
We I run this
Set s = Range(1.01, 1.02, 0.01);
Tol returns
1.01
1.02
1.03
Which has an extra element!!
Change History (4)
comment:1 Changed 21 years ago by
Owner: | changed from danirus to manuelb |
---|
comment:2 Changed 21 years ago by
Status: | new → assigned |
---|
comment:3 Changed 21 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:4 Changed 18 years ago by
bug_file_loc: | → http://cvs.tol-project.org/viewcvs.cgi/tol_tests/tol/Bugzilla/bug_000143 |
---|
Note: See
TracTickets for help on using
tickets.
A Ceil call using the result of the next operation as argument was done:
(until-from)/pass
Which, as a floating-point operation, under some circumstances can round X to get
a X.0000000000009 value. Therefore, the above operation would be rounded up to
(X+1) when using non-integer operators.
Using Abs() solves the problem.
A fix for it is already on the cvs.
Also, I have included some tests to check this behaviour in the future.