8d57b8d3d2
without possibly losing lots of precision, and print the scale using %g instead of %d in case it is non-integral. %g might not be the best format for this.