| The Mighty Boosh (3) | |
|
I have been getting weird answers when decimal numbers are input into a, b, or c variables in my quadratic equation program. I was wondering if anyone would be able to sift through some of my decimal related things in it. I wanted it to find if any of the numbers had decimals, and if any did, multiply all three variables by the smallest decimal's multiple-of-ten-that-would-make-it-zero. An example of the problem: a = 1, b = -.02, c = -1.2 output: 240.01 and -240.03 The program also accounts for imaginary numbers. Here are the areas that I think may be problem areas: http://pastie.org/private/ohrjpyvgcyuswhdb31ukw I posted a link because it was kind of lengthy. | |
|
|
|
| MiiNiPaa (226) | ||||
|
The one of the problems is with your globals and their supposed "initialization" in main() Look at the following code:
Output:
Did you see the problem? | ||||
|
Last edited on
|
||||