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

c++ - C/pp Sockets, recv()/send() works only under gdb -

GO: Serve static pages -

objective c - How to open front/back camera at the same time in iOS developing? -