display double w/o trailing zeros?
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+2
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:
could anyone assist with a method to truncate the trailing zeros?