You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A bit of testing has found that big.NewFloat(n).Text('f', -1) seems to, not surprisingly, produce significantly cleaner textual representations of numbers than just plain fmt.Printf("%v") does, allowing, for example, much higher Fibonacci numbers to be printed without resulting in scientific notation. While I'm still debating whether or not it makes sense for wdte.Number to actually be a wrapper for big.Float directly, I think it makes sense to at least give it a String() method that uses the above for now.
The text was updated successfully, but these errors were encountered:
After a bit more experimenting, it might not make sense to use just Text('f', -1). I'd like it to round large numbers of decimals but display large integers cleanly. I'm thinking something like the following:
DeedleFake
changed the title
Use big.Float to Produce Higher-Precision String Representations of Numbers
Investigate Usage of big.Float in Place of float64Sep 20, 2018
While I'd like numbers to just be float64s to make usage of them a bit easier from the Go side, I'd also kind of like to somehow make Number capable of transparent precision-less math.
A bit of testing has found that
big.NewFloat(n).Text('f', -1)
seems to, not surprisingly, produce significantly cleaner textual representations of numbers than just plainfmt.Printf("%v")
does, allowing, for example, much higher Fibonacci numbers to be printed without resulting in scientific notation. While I'm still debating whether or not it makes sense forwdte.Number
to actually be a wrapper forbig.Float
directly, I think it makes sense to at least give it aString()
method that uses the above for now.The text was updated successfully, but these errors were encountered: