Copy this code in IDE Editor Option Explicit Function Pulgada() As Single Pulgada = 25.4 End Function If use this function in a WorkSheet return the value 25.3999996185. If change the word Single for Double, return the value 25.4. I know the variable type DOUBLE is more precise than the type SINGLE, but this only using a decimal position.
Created attachment 116498 [details] test file I can confirm with Version: 5.1.0.0.alpha1+ Build ID: 782c116b5ac39aef27c3a00f7fc145c9f755e3a3 TinderBox: Linux-rpm_deb-x86_64@46-TDF, Branch:master, Time: 2015-06-10_00:04:59
** Please read this message in its entirety before responding ** To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year. There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present. If you have time, please do the following: Test to see if the bug is still present on a currently supported version of LibreOffice (5.1.5 or 5.2.1 https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the version of LibreOffice and your operating system, and any changes you see in the bug behavior If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a short comment that includes your version of LibreOffice and Operating System Please DO NOT Update the version field Reply via email (please reply directly on the bug tracker) Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case) If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) http://downloadarchive.documentfoundation.org/libreoffice/old/ 2. Test your bug 3. Leave a comment with your results. 4a. If the bug was present with 3.3 - set version to "inherited from OOo"; 4b. If the bug was not present in 3.3 - add "regression" to keyword Feel free to come ask questions or to say hello in our QA chat: http://webchat.freenode.net/?channels=libreoffice-qa Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-UntouchedBug-20160920
Hi, The problem continue in LibreOffice for Windows x64 5.2.1.2. Thank's.
This is not a bug, but simply due to the fact that a variable of type single has less precision than a number in Calc, in standard format, if this number has only a small integer part. And it’s not a behaviour restricted to LibreOffice Basic, but a general one. Numbers of type single or double are stored in a binary format; you will find the details in https://en.wikipedia.org/wiki/Single-precision_floating-point_format. By this transformation to binary format and back again to decimal format value is changed to a small extent, depending on the precision used. You can get an idea of the difference by executing the small program: sub test dim a as single, ai as long, af as double a = 25.4 ai = Int(a) 'integer part af = a – ai 'fraction part msgbox af end sub It yields 0,399999618530273 if a is of type single, and 0,399999999999999, if a is of type double I used a double variable for the result, to show as much digits.). Now Calc uses 13 digits after the decimal point in our case, where there only two digits before it. I can not swear that Calc does a rounding when transforming the return value to fit its standard format, but it does so, if you change the number of decimal digits, and this fits the results we obtain. If you round the result of our test programm to 13 decimal digits in the case of the single type, you get 0,399996185303, exactly the result I get using your function. The number you quote is slightly different, I don’t know why, but this is not important for the argument. If, on the other hand, you round the second result, this yields 0.4. So the difference between using a single or double variable is explainable, and there will be no change in future releases. If you wish to have an exact value even when using a high precision, as the standard format does in your case, you have to use the double type. If you want to use only, say, two decimal digits, then the single type is sufficient. If you accept this explanation, you should change the status to resolved.
** Please read this message in its entirety before responding ** To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year. There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present. If you have time, please do the following: Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the information from Help - About LibreOffice. If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice. Please DO NOT Update the version field Reply via email (please reply directly on the bug tracker) Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case) If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from http://downloadarchive.documentfoundation.org/libreoffice/old/ 2. Test your bug 3. Leave a comment with your results. 4a. If the bug was present with 3.3 - set version to 'inherited from OOo'; 4b. If the bug was not present in 3.3 - add 'regression' to keyword Feel free to come ask questions or to say hello in our QA chat: https://kiwiirc.com/nextclient/irc.freenode.net/#libreoffice-qa Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-UntouchedBug
The original reporter of the bug didn't respond to my explanation and the mass ping one year later. So I set the status to resolved/notabug.