Source File
itoa.go
Belonging Package
strconv
package strconv
import
const fastSmalls = true // enable fast path for small integers
func ( int) string {
if < 10 {
return digits[ : +1]
}
return smallsString[*2 : *2+2]
}
const nSmalls = 100
const smallsString = "00010203040506070809" +
"10111213141516171819" +
"20212223242526272829" +
"30313233343536373839" +
"40414243444546474849" +
"50515253545556575859" +
"60616263646566676869" +
"70717273747576777879" +
"80818283848586878889" +
"90919293949596979899"
const host32bit = ^uint(0)>>32 == 0
const digits = "0123456789abcdefghijklmnopqrstuvwxyz"
:= / 1e9
:= uint( - *1e9) // u % 1e9 fits into a uint
for := 4; > 0; -- {
:= % 100 * 2
/= 100
-= 2
[+1] = smallsString[+1]
[+0] = smallsString[+0]
}
--
[] = smallsString[*2+1]
=
}
:= uint()
for >= 100 {
:= % 100 * 2
/= 100
-= 2
[+1] = smallsString[+1]
[+0] = smallsString[+0]
}
:= * 2
--
[] = smallsString[+1]
if >= 10 {
--
[] = smallsString[]
}
:= uint64()
for >= {
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |