-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
Description
by odysseus9672:
What does 'go version' print? go version go1.3beta2 +708e129e91a9 Wed May 21 16:01:54 2014 -0700 darwin/amd64 What steps reproduce the problem? If possible, include a link to a program on play.golang.org. 1. Go does not support the hex encoded floats produceable from the C verb %a in stdio.h and float.hex/float.fromhex in Python. 2. Example numbers: pi = 0x1.921fb54442d18p+1 -e = -0x1.5bf0a8b145769p+1 15.39453125 = f.65 = 0x1.eca0000000000p+3 2^-1070 = 0x0.0000000000010p-1022 http://play.golang.org/p/446DOTlpbw What happened? A bunch of errors. What should have happened instead? Please provide any additional information below. I know that Go implements an equivalent syntax in the %b verb, but having %a would be nice for cross compatibility with C, Python, and Java. The best part is that producing the FormatFloat part of the code is trivial. The tricky part is, as always, getting the parser to work right.
Reactions are currently unavailable