class StringifyDouble {
public static void main
(String[] args
) { if (args.length > 0) {
try {
finish
= Double.
parseDouble(args
[0]); System.
err.
println("Parse " + args
[0] + " failed."); }
}
for (int i = 0; i < 54; i++) {
assert Double.
parseDouble(s
) == d
; String.
format("%s == %a",s, d
) );
if (d == finish) break;
f /= 2; d += f;
}
}
}
Y2xhc3MgU3RyaW5naWZ5RG91YmxlIHsKICAgIHB1YmxpYyBzdGF0aWMgdm9pZCBtYWluKFN0cmluZ1tdIGFyZ3MpIHsKICAgICAgICBEb3VibGUgZmluaXNoID0gMi4wOwogICAgICAgIGlmIChhcmdzLmxlbmd0aCA+IDApIHsKICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgIGZpbmlzaCA9IERvdWJsZS5wYXJzZURvdWJsZShhcmdzWzBdKTsKICAgICAgICAgICAgfSBjYXRjaCAoTnVtYmVyRm9ybWF0RXhjZXB0aW9uIGUpIHsKICAgICAgICAgICAgICAgIFN5c3RlbS5lcnIucHJpbnRsbigiUGFyc2UgIiArIGFyZ3NbMF0gKyAiIGZhaWxlZC4iKTsKICAgICAgICAgICAgICAgIFN5c3RlbS5leGl0KC0xKTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICBEb3VibGUgZCA9IGZpbmlzaC8yOwogICAgICAgIERvdWJsZSBmID0gZDsKICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IDU0OyBpKyspIHsKICAgICAgICAgICAgU3RyaW5nIHMgPSBTdHJpbmcuZm9ybWF0KCIlLjE3ZyIsIGQpOwogICAgICAgICAgICBhc3NlcnQgRG91YmxlLnBhcnNlRG91YmxlKHMpID09IGQ7CiAgICAgICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbigKICAgICAgICAgICAgICAgIFN0cmluZy5mb3JtYXQoIiVzID09ICVhIixzLCBkKQogICAgICAgICAgICApOwogICAgICAgICAgICBpZiAoZCA9PSBmaW5pc2gpIGJyZWFrOwogICAgICAgICAgICBmIC89IDI7IGQgKz0gZjsKICAgICAgICB9CiAgICB9Cn0K