Issue 4929 - sal/rtl/strtmpl.c uses imprecise code for str to double calc.
Summary: sal/rtl/strtmpl.c uses imprecise code for str to double calc.
Status: CLOSED FIXED
Alias: None
Product: porting
Classification: Code
Component: code (show other issues)
Version: current
Hardware: All All
: P3 Trivial (vote)
Target Milestone: OOo 1.1 Beta
Assignee: oc
QA Contact: issues@porting
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-05-16 05:08 UTC by nickb
Modified: 2003-03-13 11:13 UTC (History)
1 user (show)

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


Attachments
sal/rtl/source/strtmpl.c - if IRIX use libc functions (1.49 KB, patch)
2002-05-16 05:17 UTC, nickb
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description nickb 2002-05-16 05:08:08 UTC
The existing code introduces some rounding errors on IRIX. Switching to use libc
functions avoids this, and uses common code... which is only a good thing!
Comment 1 nickb 2002-05-16 05:17:14 UTC
Created attachment 1669 [details]
sal/rtl/source/strtmpl.c - if IRIX use libc functions
Comment 2 sander_traveling 2002-06-10 00:19:34 UTC
commited in rev 1.10.10.1 (OOO_STABLE_1)
Comment 3 ooo 2002-06-12 00:28:13 UTC
er->nick: Are you sure this was a good idea? On most Unix systems the printf(), scanf(), 
atof() functions and similar are known to be localized (for example, different 
decimal separators under different locales). If this is the case with IRIX then the 
patch will break functionality since the methods were designed to always use a '.' 
point as decimal separator.

For the rounding errors issue a code similar to the 
one used in SolarMath::StringToDouble() and SolarMath::DoubleToString() of 
tools/source/generic/solmath.cxx could be used. In fact it should be considered to 
move that functionality down to the rtl strings some day.
Comment 4 ooo 2002-06-17 12:26:22 UTC
Since I don't think the solution is correct and there is no further
comment on my remarks, I have to reopen this issue.
Comment 5 nickb 2002-06-18 01:24:59 UTC
Ack, sorry, been a bit swamped lately. Yes, you are correct the
libc localisation will cause problems.

I will attach a new patch soon, either forcing the locale to C for the
call to atold(), or using some code from tools/source/generic.

Thanks for pointing out the problem.
Comment 6 sander_traveling 2002-08-06 14:19:00 UTC
reassigning to Eike, as he seems interested in the issue
Comment 7 ooo 2002-08-08 10:28:24 UTC
Nice try ;-)

ok, I'll take it as a "move SolarMath to rtl" issue
Comment 8 ooo 2002-12-09 15:04:54 UTC
Target to OOo 1.1 Beta
iBIS back-reference: #103888#
Comment 9 ooo 2003-02-03 18:28:38 UTC
fixed on branch cws_srx644_rtlmath
Comment 10 ooo 2003-02-05 13:00:08 UTC
reopen to reassign
Comment 11 ooo 2003-02-05 13:01:33 UTC
reassign to QA.
Note that the change affects the entire Office on all platforms.
Comment 12 ooo 2003-02-05 13:02:00 UTC
restore status
Comment 13 oc 2003-02-10 09:42:01 UTC
Verified
Comment 14 michael.bemmer 2003-03-13 11:13:15 UTC
As mentioned on the qa dev list on March 5th I will close all resolved
<wontfix/duplicate/worksforme/invalid> issues. Please see this posting for details.