cvFloor / cvCeil may fails on integer input (Bug #2629)
Description
diff.f may be -0.f and testing diff.i < 0 is wrong.
this is not easy to reproduce, but obviously wrong.
and current complication defenition is not using SSE2 option on WIN32 for some reason
...
#else
int i = cvRound(value);
- Cv32suf diff;
- diff.f = (float)(i - value);
- return i + (diff.i < 0);
+ double diff;
+ diff = (i - value);
+ return i + (diff < 0);
#endif
History
Updated by Alexander Shishkov about 12 years ago
- Category set to core
- Priority changed from High to Normal
- Assignee set to Vadim Pisarevsky
Updated by Vadim Pisarevsky about 12 years ago
- Affected version set to 2.4.3
- Target version deleted ()
Updated by Vadim Pisarevsky about 12 years ago
- Assignee deleted (
Vadim Pisarevsky)
Updated by Vadim Pisarevsky about 12 years ago
- Assignee set to Vadim Pisarevsky
Updated by Kirill Kornyakov about 12 years ago
- Target version set to 2.4.4