I'm trying to display a list of doubles with out the trailing zeros.
This snipet is just the declaration and printf...the actual code is fine
I just need to modify these intergers for the printf
This is part of a quadradic solver. I'm inputting x^2+2x+2Code:double sq = 0, bb = 0, ac4 = 0, z = 0; long sq2 = 0, x1 = 0, x2 = 0; printf("%d+%di, %d-%di.\n\n", x1, sq, x1, sq);
and keep getting:
1.000000+1.0000000i, 1.0000000-1.0000000i
instead of;
1+1i, 1-1i
could anyone assist with a method to truncate the trailing zeros?