*Synopsis*: [ku1] libast/ksh93 1-digit hexfloat base conversion rounds incorrectly
CR 6789247 changed on Oct 23 2009 by <User 1-7MTUEB> === Field ============ === New Value ============= === Old Value ============= Commit to Fix in Build snv_127 Status 7-Fix in Progress 6-Fix Understood ====================== =========================== =========================== *Change Request ID*: 6789247 *Synopsis*: [ku1] libast/ksh93 1-digit hexfloat base conversion rounds incorrectly Product: solaris Category: shell Subcategory: korn93 Type: Defect Subtype: Status: 7-Fix in Progress Substatus: Priority: 4-Low Introduced In Release: solaris_nevada Introduced In Build: snv_72 Responsible Engineer: <User 1-7MTUEB> Keywords: opensolaris, oss-request, oss-sponsor === *Description* ============================================================ Category shell Sub-Category korn Description [The same issue was described in http://mail.opensolaris.org/pipermail/ksh93-integration-discuss/2008-December/006737.html] This is basically a spin-off of http://bugs.opensolaris.org/view_bug.do?bug_id=6773712 ("1-digit hex fp base conversion of long double rounds incorrectly"). The bug description for Solaris libc says this: > The first line of output from this program is correct. The second line > is not. > > leviathan% cat a.c > #include <stdio.h> > > int main() > { > printf("%.0a\n", 1.5); > printf("%.0La\n", 1.5L); > return 0; > } > leviathan% cc -o a a.c > leviathan% a > 0x1p+1 > 0x1p+0 > leviathan% If I compile the testcase with libast on Solaris 11/B84 SPARC (which matches ast-open.2008-11-04) I get this: -- snip -- $ cc -xc99=%all -I/usr/include/ast -last a.c -o a && ./a 0x1p+00 0x1p+00 -- snip -- ... which seems to be incorrect per the bugs comment above and should be: -- snip -- 0x1p+1 0x1p+1 -- snip -- ksh93 has the same problem: $ ksh93 -c 'float r=1.5 ; printf "%.0a\n" r' 0x1p+00 Frequency Always Regression No Steps to Reproduce Compile and run testcase like this: -- snip -- $ cc -xc99=%all -I/usr/include/ast -last a.c -o a && ./a -- snip -- Expected Result 0x1p+1 0x1p+1 Actual Result 0x1p+00 0x1p+00 Error Message(s) None Test Case #include <stdio.h> int main() { printf("%.0a\n", 1.5); printf("%.0La\n", 1.5L); return 0; } Workaround - Submitter wants to work on bug Yes Additional configuration information Solaris 11/B84 with ksh93-integration update1 (="ku1") codebase applied *** (#1 of 1): 2008-12-27 20:38:14 GMT+00:00 <User 1-F4SZV> === *Public Comments* ======================================================== === *Workaround* ============================================================= === *Additional Details* ===================================================== Targeted Release: solaris_nevada Commit To Fix In Build: snv_127 Fixed In Build: Integrated In Build: Verified In Build: See Also: 4764104, 6773712, 6793763 Duplicate of: Hooks: Hook1: Hook2: Hook3: Hook4: Hook5: <email address omitted> Hook6: <email address omitted> Program Management: Root Cause: Insufficient Testing Fix Affects Documentation: No Fix Affects Localization: No === *History* ================================================================ Date Submitted: 2008-12-27 20:38:11 GMT+00:00 Submitted By: <User 1-F4SZV> Status Changed Date Updated Updated By 3-Accepted 2009-02-24 13:53:32 GMT+00:00 <User 1-1SURPB> 6-Fix Understood 2009-06-16 15:29:06 GMT+00:00 <User 1-1SURPB> 7-Fix in Progress 2009-10-23 17:33:02 GMT+00:00 <User 1-7MTUEB> === *Service Request* ======================================================== Impact: Limited Functionality: Nonessential Severity: 5 Product Name: solaris Product Release: solaris_nevada Product Build: snv_01 Operating System: solaris_nevada Hardware: generic Submitted Date: 2008-12-27 20:38:14 GMT+00:00 === *Multiple Release (MR) Cluster* - 0 ======================================