<< Back to previous view

[PCC-301] Hex floating-point constants w/ large exponents done wrong Created: 12/Apr/11  Updated: 03/Jul/14

Status: Resolved
Project: pcc
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Fred J. Tydeman Assignee: Anders Magnusson
Resolution: Fixed Votes: 0
Environment: Intel Core i5 (64-bit mode); Linux Fedora Core 14 (64-bit); pcc 1.0.0 of 2011/02/21


 Description   
0x1p-9223372036854775808L gets converted to the value 1.L (should be 0.L).
The exponent is 2**63

 Comments   
Comment by Anders Magnusson [ 01/May/14 01:33 PM ]
Use another way to find exponent size.
Comment by Fred J. Tydeman [ 02/Jun/14 03:55 PM ]
Hex FP constants with very large exponents still done wrong in pcc 2014/04/20 on 64-bit systems.
Comment by Fred J. Tydeman [ 02/Jun/14 08:48 PM ]
Here are some of the failure cases:
 0x1p+2147483648
 0x1p+9223372036854775808
 0x1p-9223372036854775808
You can add a suffix of 'f', 'L', or nothing and all three types convert to the wrong value.
Comment by Anders Magnusson [ 03/Jul/14 07:31 PM ]
Missed checking for + in hex constant exponent. Fixed now.
Generated at Tue Sep 02 08:53:25 CEST 2014 using JIRA Enterprise Edition, Version: 3.13.1-#333.