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

java - org.apache.http.ProtocolException: Target host is not specified -

How to access user directory in lazarus? -

html - Trouble with image gallery on codepen -