https://github.com/knz/go-ilog10
Fast integer log10 in Go (number of decimal digits - 1)
https://github.com/knz/go-ilog10
Last synced: 4 months ago
JSON representation
Fast integer log10 in Go (number of decimal digits - 1)
- Host: GitHub
- URL: https://github.com/knz/go-ilog10
- Owner: knz
- License: apache-2.0
- Created: 2019-12-19T17:59:31.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-12-19T18:45:51.000Z (over 5 years ago)
- Last Synced: 2025-01-31T01:14:53.561Z (5 months ago)
- Language: Go
- Size: 7.81 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-ilog10
Fast integer log10 in Go (number of decimal digits - 1)Usage:
```go
import "github.com/knz/go-ilog10"func main() {
fmt.Println(ilog10.FastUint32Log10(1234)) // prints 3
fmt.Println(ilog10.NumInt32DecimalDigits(1234)) // prints 4fmt.Println(ilog10.FastUint64Log10(1234)) // prints 3
fmt.Println(ilog10.NumInt64DecimalDigits(1234)) // prints 4
}
```