Share

GFourier

Tracker: Bugs

5 Multiply operation is incorrect - ID: 472081
Last Update: Comment added ( mdeweerd )

The implementation of the multiply operation in operations.c appears to be
violating the assumption
that the complex product is distinct from the operands (in the case where
new_main == main).
Either the product should be a temp, or the GFCOMPLEX_MUL operation should
incorporate a temp
itself to avoid other inadvertent problems. Here is a possible
definition:

#define GFCOMPLEX_MUL(a,b,c) \
{GFREAL _a_re; _a_re = (b).re * (c).re - (b).im * (c).im; (a).im =
(b).re
* (c).im + (b).im * (c).re; (a).re = _a_re;}


Jim Kuzeja ( jkuzeja ) - 2001-10-17 14:31

5

Open

None

Nobody/Anonymous

None

None

Public


Comment ( 1 )




Date: 2002-02-21 07:42
Sender: mdeweerdAccepting Donations

Logged In: YES
user_id=149951

Good macro programming even refers to each macro parameter
only once in its body. Therefore, b and c should be copied
in a local parameter and a could be assigned like it is done
in an array initializer.


Log in to comment.

Attached File

No Files Currently Attached

Change

No changes have been made to this artifact.