Bug 91350 - The bin2dec function returns a wrong value whe the binary number used as argument exceeeds a limi
Summary: The bin2dec function returns a wrong value whe the binary number used as argu...
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.4.2.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-18 02:09 UTC by Carlos Sevcik
Modified: 2015-05-18 17:51 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Spreadsheet showing the bug (7.54 KB, application/vnd.oasis.opendocument.spreadsheet)
2015-05-18 02:09 UTC, Carlos Sevcik
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Sevcik 2015-05-18 02:09:41 UTC
Created attachment 115689 [details]
Spreadsheet showing the bug

The decimal value returned by the Calc BIN2DEC() function is wrong when the binay argument excceeds a certain sixe, for examole:

BIN2DEC(100001001) -> 265 (right)
NIN2DEC(1100001001) -> -247 (Wrong)

There is no reseason to render correctly a 9 bit number as its positive decimal value, and to render a ten bit numender as a negative integer.
Comment 1 Julien Nabet 2015-05-18 17:51:55 UTC
It's not a bug since, according to https://help.libreoffice.org/Calc/Add-in_Functions,_List_of_Analysis_Functions_Part_One#BIN2DEC, if the number of bits is 10, the left bit is considered as the sign bit.