- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I'm puzzled by an apparently inconsistencyin IPP's rounding off results:
In the first example the real result is 2.5 and IPP rounds it off to 2.
In the second example the real result is 93.5 and IPP rounds it off to 94.
Why is the 0.5 result sometimes rounded up and sometimes down?
e.g.
I'm using multiply by constant function with scaling 7 , in two cases:
(I'm giving an example for a single pixel result)
ippiMulC_16s_C1RSfs(Coeficient, ImagePtr, ImageBytesStep, RoiWork, 7);
A) Coeficient = 2, Image Pixel = 160
Result pixel is : 2 x 160 Scaled by 2^7 => 2.5 => IPP rounds the result to 2
B) Coeficient = 44, Image Pixel = 272
Result pixel is :44 x272 Scaled by 2^7 =>93.5 => IPP rounds the result to94
Thanks in advance
Offir
I'm puzzled by an apparently inconsistencyin IPP's rounding off results:
In the first example the real result is 2.5 and IPP rounds it off to 2.
In the second example the real result is 93.5 and IPP rounds it off to 94.
Why is the 0.5 result sometimes rounded up and sometimes down?
e.g.
I'm using multiply by constant function with scaling 7 , in two cases:
(I'm giving an example for a single pixel result)
ippiMulC_16s_C1RSfs(Coeficient, ImagePtr, ImageBytesStep, RoiWork, 7);
A) Coeficient = 2, Image Pixel = 160
Result pixel is : 2 x 160 Scaled by 2^7 => 2.5 => IPP rounds the result to 2
B) Coeficient = 44, Image Pixel = 272
Result pixel is :44 x272 Scaled by 2^7 =>93.5 => IPP rounds the result to94
Thanks in advance
Offir
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Offir,
IPP provides the same behavior as HW provides by default - and it's mentioned in ippsmanual - all IPP functions by default round FP result to the nearest-even in order to provide more uniform distribution of results. So called "accounting" rounding (when 0.5 is always rounded up) is not uniform as results are always slightly shifted up.
Regards,
Igor
IPP provides the same behavior as HW provides by default - and it's mentioned in ippsmanual - all IPP functions by default round FP result to the nearest-even in order to provide more uniform distribution of results. So called "accounting" rounding (when 0.5 is always rounded up) is not uniform as results are always slightly shifted up.
Regards,
Igor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Many thanks Igor

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page