Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subtraction of double with Complex has wrong output #400

Open
GoogleCodeExporter opened this issue Apr 17, 2016 · 1 comment
Open

Subtraction of double with Complex has wrong output #400

GoogleCodeExporter opened this issue Apr 17, 2016 · 1 comment

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?
Following function (in AForge.Math.Complex):

public static Complex Subtract( double s, Complex a )
{
     return new Complex( s - a.Re, a.Im );
}

The return value contains an error. The imaginary part should also be negated:

public static Complex Subtract( double s, Complex a )
{
     return new Complex( s - a.Re, - a.Im );
}

What version of the product are you using?
2.2.5

Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 8 Mar 2015 at 8:26

@GoogleCodeExporter
Copy link
Author

(note: function public static void Subtract( double s, Complex a, ref Complex 
result ) has same issue)

Original comment by [email protected] on 8 Mar 2015 at 8:52

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant