Issue 128518 - Basic - Converting "+1" to a number
Summary: Basic - Converting "+1" to a number
Status: UNCONFIRMED
Alias: None
Product: App Dev
Classification: Unclassified
Component: scripting (show other issues)
Version: 4.1.12
Hardware: PC Windows, all
: P5 (lowest) Minor
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-23 15:14 UTC by Czesław Wolański
Modified: 2022-06-23 15:19 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Czesław Wolański 2022-06-23 15:14:30 UTC
Topic "CINT("+1") returns 0" on the English forum
https://forum.openoffice.org/en/forum/viewtopic.php?t=107921


Let's juxtapose relevant functions for the "+1" argument:
---> CInt() and CLng() return 0
---> CDec() returns 1
---> CSng() and CDbl create error message:

         "Inadmissible value or data type.
          Data type mismatch."

In case of implicit conversion:

 dim v as Integer REM  Integer | Long | Single | Double
 v = "+1"

the result is always 0

Besides isNumeric("+1") returns False
( see Issue 92057 - BASIC-Function isnumeric )


In VBA Excel each of the functions: CInt, CLng, CDec, CSng, CDbl
returns 1. That also happens in Basic in LibreOffice.

OpenOffice either returns an unexpected value or throws an error.
It should return 1.