Bug 67394 - Macros: csng and cdbl does not convert negative exponent numbers
Summary: Macros: csng and cdbl does not convert negative exponent numbers
Status: RESOLVED DUPLICATE of bug 98778
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
4.1.0.4 release
Hardware: Other Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: BSA
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-27 11:11 UTC by Viktor Mileikovskyi
Modified: 2019-08-29 23:35 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Viktor Mileikovskyi 2013-07-27 11:11:17 UTC
Problem description:
csng and cdbl return Error 13 if the number has negative exponent.
Tested on Ukrainian and USA standards/interface

Steps to reproduce:
1. Open LibreOffice Calc and it's IDE
2. Paste the following example. The following comments shows current answers:

Sub Example
    Print val("-3.14e2")   '-314
    Print val("-3.14e-2")  '-3,14E-02
    Print cdbl("-3,14e2")  '-314
    Print cdbl("-3,14E-2") 'Inadmissible value or data type.
                           'Data type mismatch
End Sub

3. Replace all commas by Your local decimal separator. It is very important!
4. Run it

Current behavior:
The answers are shown in comments:
    -314
    -3,14E-02
    -314
    Inadmissible value or data type. Data type mismatch
Expected behavior:
    -314
    -3,14E-02
    -314
    -3,14E-02

The LibreOffice forum contains thread:
en.libreofficeforum.org/node/5702
The proposed workaround is to use val. It works only on point separated numbers so it cannot be used on localized numbers.

With best regards.
Viktor.

Operating System: Ubuntu
Version: 4.1.0.4 release
Comment 1 pierre-yves samyn 2014-01-18 12:05:46 UTC
Hello

I reproduce on windows 7/64 with Version: 4.2.0.2
Build ID: cd65d6220c5694ee7012d7863bcde3455c9e3c30

Regards
Pierre-Yves
Comment 2 Joel Madero 2015-05-02 15:42:21 UTC Comment hidden (obsolete)
Comment 3 pierre-yves samyn 2015-05-09 10:34:45 UTC
Hi

Still reproduced on windows 7/64 & Version: 4.4.3.2
Build ID: 88805f81e9fe61362df02b9941de8e38a9b5fd16
Locale: fr_FR

Regards

Pierre-Yves
Comment 4 QA Administrators 2016-09-20 09:42:37 UTC Comment hidden (obsolete)
Comment 5 Julien Nabet 2019-07-01 18:58:25 UTC
On pc Debian x86-64 with master sources updated today, I don't reproduce and have the right values.
Idem with LO Debian package 6.1.5.2.
Could someone give a new try with a recent LO version?
Comment 6 himajin100000 2019-08-27 06:01:02 UTC
Caolán, I guess you have a good knowledge on this matter, considering your fix in tdf#98778
Comment 7 Caolán McNamara 2019-08-29 18:28:09 UTC
I imagine this is a duplicate of bug 98778 given the versions is reported in and the similar effect and that its not currently reproducible.

*** This bug has been marked as a duplicate of bug 98778 ***