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

Pre> 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

Popular posts from this blog

Folder list php -

testing Spring-Security -

javascript - NodeJS "Error code: ERR_EMPTY_RESPONSE" -