If you have a variable exponent, then don't you have a floating-point representation by definition?
The following link is an example of a good quality fixed point math library and shows you how it is done.
https://pkg.go.dev/github.com/shopspring/decimal?utm_source=...