Converting from an integer to its binary representation

前端 未结 7 974
野的像风
野的像风 2020-12-24 00:09

Has anyone got an idea if there is any inbuilt functionality in Go for converting from any one of the numeric types to its binary number form.

For example, if

相关标签:
7条回答
  • 2020-12-24 00:55

    See also the fmt package:

    n := int64(123)
    fmt.Printf("%b", n)  // 1111011
    
    0 讨论(0)
提交回复
热议问题