in reply to Constructing complex numbers using recursion
By looking at your original code and your explanation how you judge whether it is polar form, it is clear that your code is a dead loop.
Your constructComplex() calls itself unless it is not in polar form. The way you check whether it is in polar form is to see whether there is a _ in the middle of the string (not the first char). You does that PolarToRect() convertion, however the return tells us that the rect form also has a _ in it. Now your rect form seems to the computer as a polar form because of that _ in the middle... So your program just goes on and on, as it never sees an input that is not polar form based on its judgement.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Constructing complex numbers using recursion
by moltar512 (Sexton) on Nov 08, 2005 at 05:50 UTC | |
by graff (Chancellor) on Nov 08, 2005 at 06:06 UTC |