- https://github.com/golang/go/issues/4594
- https://groups.google.com/forum/#!searchin/golang-nuts/math.Round/golang-nuts/ITZV08gAugI/pNsL5FF4pLUJ
I know it's hard. But hey, most languages provide it.
Rob Pike:
Floating point numbers don't have digits.
The bar for being useful needs to be pretty high to be in the Go math package. We accepted most of what's in the C library but we're not going to take all the routines from other libraries. The Javascript round is a 1-liner: int(f+0.5).
No comments:
Post a Comment