scala> 3.toBinaryString
res0: String = 11
Scala has an implicit conversion from Int to RichInt which has a method toBinaryString. This function does not print the leading zeroes though.
scala> 3.toBinaryString
res0: String = 11
Scala has an implicit conversion from Int to RichInt which has a method toBinaryString. This function does not print the leading zeroes though.