Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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)

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 4

fmt.Println(ilog10.FastUint64Log10(1234)) // prints 3
fmt.Println(ilog10.NumInt64DecimalDigits(1234)) // prints 4
}
```