Issue Details (XML | Word | Printable)

Key: PCC-413
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Anders Magnusson
Reporter: Fred J. Tydeman
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
pcc

complex divide wrong

Created: 25/Dec/12 06:45 PM   Updated: 02/Jul/14 02:15 PM
Component/s: None
Affects Version/s: None
Fix Version/s: None

Environment: Intel x86/x87, Fedora Core 16, pcc 2011/12/16


 Description  « Hide
Complex divide gets wrong answer. Either divide is bad or alignment is wrong. The imaginary part of the result
has the exponent in the wrong place. So, instead of a NaN, it gets a denormal number. Complex numbers are
supposed to be treated as an array of two floating-point numbers.

static _Complex double res, left, right;
  res = left / right; /* both left and right are 0.0+0.0*I */

Produces:
res .im=00000000fff80000=+2.12173675827594550e-314
want .im=fff8000000000000=-nan
left .re=0000000000000000=+0.00000000000000000e+00
left .im=0000000000000000=+0.00000000000000000e+00
right.re=0000000000000000=+0.00000000000000000e+00
right.im=0000000000000000=+0.00000000000000000e+00


 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Anders Magnusson made changes - 30/Apr/14 05:56 PM
Field Original Value New Value
Assignee Anders Magnusson [ ragge ]
Anders Magnusson made changes - 30/Apr/14 05:57 PM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
Anders Magnusson made changes - 02/Jun/14 03:51 PM
Resolution Fixed [ 1 ]
Status Resolved [ 5 ] Reopened [ 4 ]
Anders Magnusson made changes - 02/Jul/14 02:15 PM
Status Reopened [ 4 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]