[Libreoffice-bugs] [Bug 131241] New: Hex value gives negative long / single / double number
bugzilla-daemon at bugs.documentfoundation.org
bugzilla-daemon at bugs.documentfoundation.org
Mon Mar 9 16:26:37 UTC 2020
https://bugs.documentfoundation.org/show_bug.cgi?id=131241
Bug ID: 131241
Summary: Hex value gives negative long / single / double number
Product: LibreOffice
Version: 6.4.1.2 release
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: BASIC
Assignee: libreoffice-bugs at lists.freedesktop.org
Reporter: sng at hellug.gr
Description:
A hex value assigned to a long variable gives a negative number, instead of a
correct number.
LO 6.1.5 debian: aLong = &HFFE0
(aLong = 65,504)
LO 6.4.1 manjaro: aLong = &HFFE0
(aLong = -32)
Steps to Reproduce:
Just run this and get an overflow error
Sub aLetterExample
Dim aLetter As Long
aLetter = &HFFE0
msgbox chr(aLetter)
End Sub
This would work on both versions
Sub aLetterExampleFix
Dim aLetter As Long
aLetter = CLng("&HFFE0")
msgbox chr(aLetter)
End Sub
Actual Results:
-32
Expected Results:
65504
Reproducible: Always
User Profile Reset: No
Additional Info:
assign 65504 tp variable
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20200309/61e287e3/attachment.htm>
More information about the Libreoffice-bugs
mailing list