| Summary: | Other: strange behaviour of round down function | ||
|---|---|---|---|
| Product: | LibreOffice | Reporter: | novell191 |
| Component: | Calc | Assignee: | Not Assigned <libreoffice-bugs> |
| Status: | RESOLVED NOTABUG | ||
| Severity: | normal | CC: | miguelangelrv |
| Priority: | medium | ||
| Version: | 4.0.4.2 release | ||
| Hardware: | Other | ||
| OS: | Linux (All) | ||
| Whiteboard: | BSA | ||
| Crash report or crash signature: | Regression By: | ||
| Attachments: | just an example to clarify | ||
Please take a look to this bug: https://bugs.freedesktop.org/show_bug.cgi?id=37923 Try formatting the subtracted numbers with 15 decimal places to see there is no decimals beyond the second one. i checked, the difference wasn't -0,02, but -0,019999999999996, so the round function work properly the new question is why the difference give that "strange" number? 100 - 100,02 = -0,02 not -0,01999... I think you can find an accurate explanation here: http://en.wikipedia.org/wiki/Floating_point#Accuracy_problems understood, i will found a workaround, thanks Hi novell191, thanks for your collaboration. Maybe a formula like this can help in your situation: =ROUNDDOWN(ROUND(100-100,2;3);2) Making first a simple ROUND() with a decimal plus than in the ROUNDDOWN(). Changed the status to resolved notabug. Please if you are not agree reopen it. this work properly! Thanks! |
Created attachment 81865 [details] just an example to clarify Problem description: i'm not sure about name function, i use different language. When i round down the difference of 2 number and the weight for rounding has opposite sign of the number to round i get error 502 trying to avoid this problem i find another one. If i try to round down at 2nd decimal witch has no need to be rounded i get error for example: right way 0,02 -> 0,02 round down function 0,02 -> 0,01 Operating System: Ubuntu Version: 4.0.4.2 release