I'm looking for an algorithm that takes a 64-bit floating point number and outputs an exponent and coefficient so the input can be represented in the form float64 input = coefficient * 10 ^ exponent
.
Supposedly this is 'not trivial', and many implementations of accurate decimal formats for Golang (which doesn't have a built-in decimal type) have some kind of hack for it like converting to a string and parsing that. While that solution does work in the packages I've seen, it just seems 'proper' to do it the mathematical/computer science-y way.