Anonymous user
Non-decimal radices/Convert: Difference between revisions
→{{header|Go}}
m (fix bare lang tag) |
|||
Line 491:
=={{header|Go}}==
<lang go>
import (
s := strconv.Itob(26, 16) // returns the string 1a▼
"fmt"
i,_ := strconv.Btoi64("1a", 16) // returns the integer 26</lang>▼
"math/big"
"strconv"
)
func main () {
fmt.Println(s)
if err == nil {
fmt.Println(i)
}
b, ok := new(big.Int).SetString("1a", 16) // returns the big integer 26
if ok {
fmt.Println(b)
}
}</lang>
=={{header|Groovy}}==
|