Description: When calculating the difference between two datetime values in Calc, the result is different depending on whether the numbers are formatted as date/time (correct) or decimal (wrong result). See the attached example. Steps to Reproduce: See the spreadsheet attached. Actual Results: Caculation result depends on number format. Expected Results: Caculation result must not depend on number format. Reproducible: Always User Profile Reset: No Additional Info: Verified on both Windows with version 7.0.6.2 and macOS with version 7.3.4.2
Created attachment 181155 [details] Example spreadsheet
Repro using Version: 7.3.5.1 (x64) / LibreOffice Community Build ID: d56c1c78db15939340c3db8ee3b6667832313d23 CPU threads: 12; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win Locale: ru-RU (ru_RU); UI: en-US Calc: CL Doing hard recalc (Ctrl+Shift+F9) does not change the result. Cloning the formats from one row to the other and hard-recalc changes the calculation result. The document has "Precision as shown" *unset*. This is not reproducible using Version: 6.0.0.3 (x64) Build ID: 64a0f66915f38c6217de274f0aa8e15618924765 CPU threads: 12; OS: Windows 10.0; UI render: GL; Locale: ru-RU (ru_RU); Calc: CL but repro using Version: 6.3.0.4 (x64) Build ID: 057fc023c990d676a43019934386b85b21a9ee99 CPU threads: 12; OS: Windows 10.0; UI render: GL; VCL: win; Locale: ru-RU (ru_RU); UI-Language: en-US Calc: CL It is different using Version: 6.2.0.3 (x64) Build ID: 98c6a8a1c6c7b144ce3cc729e34964b47ce25d62 CPU threads: 12; OS: Windows 10.0; UI render: GL; VCL: win; Locale: ru-RU (ru_RU); UI-Language: en-US Calc: CL in the latter, hard recalc puts 0:29 to the both cells.
The change in 6.3 happened after commit 85c0521f01f5c726e9f754b3175a550121e566c8.
Something to do with tdf#127334? https://bugs.documentfoundation.org/show_bug.cgi?id=127334#c1
So what do you expect? We introduced some special handling for subtracting date+time formatted values to yield better results, and these 44749.3333333333 and 44749.3541666667 are not exact (neither decimal nor binary floating point) numbers, and displaying the result from this calculation in time format is slightly off. Yes.