[Solved] Unexpected value after repeated increments

Discuss the spreadsheet application
Locked
clag
Posts: 79
Joined: Thu Apr 23, 2015 8:12 pm

[Solved] Unexpected value after repeated increments

Post by clag »

Hello and good day to all
I tried to generate columns of numbers with constant downward increments of 0.1, but after 20-50 steps, AOO starts to stutter and generates incorrect values. It doesn't matter whether I use the automatic mouse drag version or a formula with -0.1.
Is this only happening on my system, or do others have the same problem?
I first noticed the issue when the expected zero in the format 0.00 wasn't zero, than I looked closer what happens
calculation_error.ods
(22.82 KiB) Downloaded 66 times
Example table is attached.

greets clag
Last edited by MrProgrammer on Sun Jan 18, 2026 4:44 pm, edited 1 time in total.
Apache OpenOffice 4.1.16 on Win 10
User avatar
robleyd
Moderator
Posts: 5504
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: calculation error

Post by robleyd »

Calc: Accuracy problem

Round the result to e.g. 2 places.
Attachments
calculation_error.ods
(26.71 KiB) Downloaded 59 times
Slackware 15 (current) 64 bit
Apache OpenOffice 4.1.16
LibreOffice 26.2.3.2; SlackBuild for 26.2.3 by Eric Hameleers
---------------
I hate this damn computer, I wish that I could sell it.
It won't do what I want it to, Only what I tell it.
clag
Posts: 79
Joined: Thu Apr 23, 2015 8:12 pm

Re: Calculation error

Post by clag »

Hello Robleyd
yeah I have done it like you suggested
I just wonder why few 20+1 create such e problem there was just integers

anyway thanks clag
Apache OpenOffice 4.1.16 on Win 10
User avatar
Lupp
Volunteer
Posts: 3756
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Calculation error

Post by Lupp »

See attached example which contains some explanations:
aoo_113299_DyadicRoundingVsDecimalExpectation.ods
(84.27 KiB) Downloaded 77 times
On Windows 10: LibreOffice 25.8.4 and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
clag
Posts: 79
Joined: Thu Apr 23, 2015 8:12 pm

Re: Calculation error

Post by clag »

Hello Lupp

Thanks for your explanation, the solution for my problem is than simple: I just create a column with increase the number by 1 and then divide the result by 10, copy and past the Numbers and everything works perfectly.
I really appreciate it, if there is a logic it is easy to remember

greets clag
Apache OpenOffice 4.1.16 on Win 10
User avatar
Lupp
Volunteer
Posts: 3756
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Calculation error

Post by Lupp »

clag wrote: Thu Jan 08, 2026 10:07 pm (1) ... I just create a column with increase the number by 1 and then divide the result by 10, ...
(2) ... copy and paste the numbers and everything works perfectly.
(1) Good idea.

(2) Why? Do the division in an extra column. You may hide the helper column with integers then.
If you now need to change the starting value, no Copy/Paste will be needed.
On Windows 10: LibreOffice 25.8.4 and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
clag
Posts: 79
Joined: Thu Apr 23, 2015 8:12 pm

Re: Calculation error

Post by clag »

Moin Lupp and everybody else

the reason for copy and pastet only the values is, that I think Calc calculate always the whole sheet again or all sheets if there are relations between them, if there is a change in any data on that sheet. I just want to reduce the calculating work for Calc.
I just generate this colums only one time and it will not change, so I think its unnecsessery work for Calc to recalculate this values ervery times again, when the formulas are still in the cells. !?

thanks clag
Apache OpenOffice 4.1.16 on Win 10
User avatar
Lupp
Volunteer
Posts: 3756
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Calculation error

Post by Lupp »

There are a few volatile functions which cause the recalculation of formulas they are used in "on next to any event" (including e.g. Del applied to an already blank cell, but not a change of the selection). The relevant examples are NOW(), DATE(), RAND(), RANDBETWEEN().
Recent versions of LibreOffice have also the non-volatile versions RAND.NV() and RANDBETWEEN.NV(). There are also tools to insert fix values of date or time without using a cell formula.

However, at the heart of modern spreadsheet software are algorithms which restrict the need of recalculations as far as possible. The principle may be called "Recalculate On Demand".
As far as I understand it, I would describe it this way:
Cells not in the current view referencing cells or ranges which changed contents or results are not necessarily recalculated immediately, but marked "dirty". If anywhere a cell which contains a reference to a dirty cell shall be recalculated (moved into the view e.g.), there is first a check if dirty cells are referenced. If so, these are recalculated in advance of recalculating the formula having caused the check.

Things should be better explained here: https://lord.io/spreadsheets/ .

[Cells using the mentioned .NV functions of LibO and nothing else except constants/literals are never marked "dirty".]
On Windows 10: LibreOffice 25.8.4 and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
morchat
Posts: 58
Joined: Wed Dec 26, 2012 6:13 pm
Location: Poland

Re: Calculation error

Post by morchat »

The spreadsheet stores all numerical values ​​as floating-point numbers. This means that some values ​​cannot be finitely transformed, hence the results. These differences, of course, appear at the far decimal places. If these numbers are only for presentation purposes, they simply need to be formatted appropriately. However, if they are involved in calculations, they should be rounded using the ROUND() function, then copied (CTRL+V) and pasted back as values ​​using Paste Special (SHIFT+CTRL+V).
AOO 4.1.16, LibreOffice 25.8
Windows 11 64 bits
Locked