[Bug c/28038] Double to char conversion fails at 32769.0

2006-06-15 Thread barryb at cwipapps dot net
--- Comment #4 from barryb at cwipapps dot net 2006-06-15 17:15 --- Sorry, you are right; you have to cast it twice. I'd moved on to d is 32765.00, as integer is 0x7ffd, and (ushort)d is 0x7ffd while (uchar)(ushort)d is 0xfd d is 32766.00, as integer is 0x7ffe

[Bug c/28038] Double to char conversion fails at 32769.0

2006-06-15 Thread barryb at cwipapps dot net
--- Comment #2 from barryb at cwipapps dot net 2006-06-15 15:54 --- The integers in the example ARE all within the range of unsigned short. Therefore Falk's comments may be true, but are not relevant. Note also that the same code works as expected on sparc. We think that the pr

[Bug c/28038] New: Double to char conversion fails at 32769.0

2006-06-15 Thread barryb at cwipapps dot net
Product: gcc Version: 3.4.5 Status: UNCONFIRMED Severity: major Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: barryb at cwipapps dot net GCC build triplet: gcc (GCC) 3.4.5 20051201