generics - Generate an integer binary representation using Swift? -
How to create a function of accepting any kind of int or UIT in swift (and about the type of bits
init & lt; T: _SignedIntegerType & gt; (_ V: T, radix: int, uppercase: boole = default) init & lt; T: _UnsignedIntegerType & gt; (_ V: T, radix: int, uppercase: boole = default)
which can be used here:
num = 100 commands Give string (num, radix: 2) print (str) // output: 1100100
Comments
Post a Comment