-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Description
See https://groups.google.com/d/topic/golang-dev/oIB-wBj3ufw/discussion.
The language specification never mentioned binary exponent float representation, but it was previously included in the gc implementation and it is included as a formatting option via strconv.AppendFloat with the 'b' fmt argument. However, it now lives on as a parsing option only in the compiler and test code in strconv.
The capacity to represent exact float values in a clear human-readable way is valuable in numeric code, for example here, where otherwise comments are required to explain the magic hex.
It is not clear how this should be included, since parsing a string is failable at runtime and these values are likely to nearly always be compile time constants.
/cc @griesemer