Bug 107953 - Not enough precision when showing single-precision variable in BASIC debugger watch
Summary: Not enough precision when showing single-precision variable in BASIC debugger...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: lowest enhancement
Assignee: Andreas Heinisch
URL:
Whiteboard: target:7.3.0
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-19 12:01 UTC by Mike Kaganski
Modified: 2023-10-20 12:33 UTC (History)
4 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 Mike Kaganski 2017-05-19 12:01:42 UTC
As described on https://randomascii.wordpress.com/2012/03/08/float-precisionfrom-zero-to-100-digits-2/, to uniquely identify a single, it is required to show 9 decimal digits (and 17 for double). Currently, watch in BASIC IDE shows only 7 decimals for single, so e.g.

> dim s1 as single, s2 as single, d as double
> s1 = 1.1754943
> s2 = 1.1754944
> d = s2 - s1

would show s1 and s2 *both* as 1.175494, while d would contain 1.192E-07, showing that the shown precision is not enough.

The suggestion is to show 9 significant digits for single values.
Comment 1 tagezi 2017-05-19 12:08:48 UTC
I confirm this. The debugger shows only 6 sing after dot.
Comment 2 Buovjaga 2017-05-19 14:14:04 UTC
Adding Arnaud. Maybe he wants to take a look.
Comment 3 Commit Notification 2021-07-28 07:58:10 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/a330732cf8aaa5770bef0b49c113a57ca5e85e10

tdf#107953 - Extend significant digits

It will be available in 7.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.