Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Visitor!
I have a question.
Why do the results of the following expressions differ in qlikview?
num("06.05.2013"+"10:00" + 14*(+1/48) ,"#.##0,00000000000000") =
41.400,70833333332800
num("06.05.2013"+"17:00","#.##0,00000000000000") =
41.400,70833333333600
Hope to hear from you.
Regards,
Tjeerd
QlikView internally uses binary floating numbers (base 2) according to the IEEE standard.
What you see is not an error in QlikView. And it's not an error in IEEE 754. It's an error in the expectation and usage of binary floating point numbers. Once you understand what binary floating point numbers really are, it makes perfect sense.
So the error is really not an error - it's simply that some values cannot be exactly represented as binary numbers, so you get rounding errors. There's no way around it. The error in your case is equivalent to 10 pikoseconds, which is roughly equivalent to the precision you would expect from 64-bit binary floating numbers. So small that I wouldn't bother...
See more on
Binary floating point and .NET
these articles are about .Net, but most of it is applicable also in QlikView arithmentics.
HIC
PS
A good way to look at the number in these cases, is to format it in binary format or hexadecimal format:
num('10:00'+7/24,'(BIN) 0.000000000000000000000000000000000000000000000000000000')
or
num('17:00','(HEX) 0.000000000000000000')
HIC