Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
jrepucci15
Creator
Creator

Rounding differences between QV 11 & 12

Has anyone noticed that rounding is performing differently in QV11.20 vs QV12.10?

=NUM(102.06500, '#.00')  & =num(102.07500, '#.00')

QV version102.06500102.07500
QV11.20 SR9102.07102.07
QV12.10 SR3102.06102.08

Is this a bug or a design difference?

John

1 Solution

Accepted Solutions
hic
Former Employee
Former Employee

There is a design difference. Or rather, it is a bug-fix. There was a bug that caused a small unnecessary internal rounding, and that resulted in some corner cases being incorrectly rounded. But it was really only visible in cases where you wanted a tie-breaking, e.g.: Should 0.65 be rounded upwards to 0.7 or downwards to 0.6? So the version 12 behaviour should be more correct.

Note also that 102.065 cannot be exactly represented internally - it has no exact binary representation. Hence, it is really not a tie-breaking issue. The number is always below or above the cutoff limit. See Rounding Errors.

If you want to test how the QIX engine handles real tie-breaks, you need to use exact binary numbers. Then you will find that it always rounds upwards, and that it hasn't changed between v11.2 and v12.

v11.2.png

v12.png

View solution in original post

2 Replies
MarcoWedel

Maybe hiccan help?

hic
Former Employee
Former Employee

There is a design difference. Or rather, it is a bug-fix. There was a bug that caused a small unnecessary internal rounding, and that resulted in some corner cases being incorrectly rounded. But it was really only visible in cases where you wanted a tie-breaking, e.g.: Should 0.65 be rounded upwards to 0.7 or downwards to 0.6? So the version 12 behaviour should be more correct.

Note also that 102.065 cannot be exactly represented internally - it has no exact binary representation. Hence, it is really not a tie-breaking issue. The number is always below or above the cutoff limit. See Rounding Errors.

If you want to test how the QIX engine handles real tie-breaks, you need to use exact binary numbers. Then you will find that it always rounds upwards, and that it hasn't changed between v11.2 and v12.

v11.2.png

v12.png