I'm not sure they are actually required to produce the same string.
My reasoning:
"k is a scale factor that defaults to one (not zero)" -
So k is 1.
"If k is positive, then it must be strictly less than d+2; k significant digits are printed before the decimal point, and d-k+1 digits are printed after the decimal point."
Both "10.0e+1" and "1.0e+2" have 1 /significant/ digit before the decimal point.
d-k+1 = 1
Both have 1 digit after the decimal point, so unless there are other constraints which I missed, they both seem legal to me.
Can you lay out your reasoning as to why they should produce the same output?
I'm not sure they are actually required to produce the same string.
My reasoning:
"k is a scale factor that defaults to one (not zero)" -
So k is 1.
"If k is positive, then it must be strictly less than d+2; k significant digits are printed before the decimal point, and d-k+1 digits are printed after the decimal point."
Both "10.0e+1" and "1.0e+2" have 1 /significant/ digit before the decimal point.
d-k+1 = 1
Both have 1 digit after the decimal point, so unless there are other constraints which I missed, they both seem legal to me.
Can you lay out your reasoning as to why they should produce the same output?