Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/knz/go-ilog10
Fast integer log10 in Go (number of decimal digits - 1)
https://github.com/knz/go-ilog10
Last synced: 26 days 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 (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2019-12-19T18:45:51.000Z (almost 5 years ago)
- Last Synced: 2024-05-02T00:12:49.144Z (6 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
}
```