Bug 150921 - FORMATTING: For some ranges of numbers, the TEXT (DEC2HEX (<number>) function gives strange results
Summary: FORMATTING: For some ranges of numbers, the TEXT (DEC2HEX (<number>) function...
Status: RESOLVED INVALID
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.4.0.3 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-12 21:37 UTC by Robert Gralak
Modified: 2022-09-12 22:40 UTC (History)
0 users

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 Robert Gralak 2022-09-12 21:37:40 UTC
Description:
I have the formula '=TEXT(DEC2HEX(<number>);"#")'. For numbers "1" to "479" the result is "1"-"1DF". For 480 it is "1", 481 - "10", 482 - "100", and so on. Starting with 490, "1EA" is correct again. The next strange range is from 736 to 745 ("2" - "2,000,000,000").
Try numbers between 11776 and 11929: following groups of 10 wrong formatting and 6 correct.
Try to use '=TEXT(DEC2HEX(11929);"#")'. The result is "2" and 99 zeros.
Because this behaviour is cyclic I believe that fix of this should be quite simple.

Steps to Reproduce:
1.Enter formula '=TEXT(DEC2HEX(11929);"#")' into a cell


Actual Results:
2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

Expected Results:
2E99


Reproducible: Always


User Profile Reset: Yes


OpenGL enabled: Yes

Additional Info:
Version: 7.4.0.3 (x64) / LibreOffice Community
Build ID: f85e47c08ddd19c015c0114a68350214f7066f5a
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: pl-PL (pl_PL); UI: pl-PL
Calc: threaded
Comment 1 Rafael Lima 2022-09-12 22:40:20 UTC
This bug was reported twice. Lets use bug 150923 to discuss this issue.