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

Too long return value #4

Closed
SmoliakAndrii opened this issue Apr 19, 2018 · 0 comments
Closed

Too long return value #4

SmoliakAndrii opened this issue Apr 19, 2018 · 0 comments

Comments

@SmoliakAndrii
Copy link

public INumber Multiply(INumber iNumber) 
{ //a+bi //c+di //(ac - bd) + (ad + bc)i 
ComplexNumber second = iNumber as ComplexNumber; 
return new ComplexNumber(Real * second.Real - Imaginary * second.Imaginary, Real * second.Imaginary + Imaginary * second.Real);
}

i think better change to:
ComplexNumber result = new ComplexNumber(Real * second.Real - Imaginary * second.Imaginary, Real * second.Imaginary + Imaginary * second.Real);
return result;

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

No branches or pull requests

2 participants