https://bz.apache.org/ooo/show_bug.cgi?id=126830
bmarcelly <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #1 from bmarcelly <[email protected]> --- Created attachment 85285 --> https://bz.apache.org/ooo/attachment.cgi?id=85285&action=edit Modified example with all decimals This is the classical case showing that floating point data do not have infinite precision. Numbers in Calc are internally coded in a 8-bytes format that can produce around 16 significant digits. See https://en.wikipedia.org/wiki/Double-precision_floating-point_format Time 14:00:00 is internally coded as 14/24 = 0.58333333333333333333333333333333333333333333 ad infinitum. This value cannot be represented with perfect accuracy. When working with floating points you must take account of this inevitable inaccuracy. See https://en.wikipedia.org/wiki/Floating_point#Accuracy_problems In the attached spreadsheet I have used a cell format showing 20 decimals (more than the maximum precision). You can see that H4 and H5 are both incorrect, due to limited precision. G4 and G5 are displayed identical, but internally they are not exactly 300. Computing a modulo on numbers other than integers is a nonsense (although Calc accepts it). In cells G14 and G15 I have rounded G4 and G5 to the nearest integer. And then the modulo is correct. _NOT A BUG_ -- You are receiving this mail because: You are the assignee for the issue.
