An open API service indexing awesome lists of open source software.

https://github.com/bodacious/binary

A to_binary library for Ruby integers
https://github.com/bodacious/binary

Last synced: 9 days ago
JSON representation

A to_binary library for Ruby integers

Awesome Lists containing this project

README

          

# Convert Ruby Integers to Binary

## Note

This library probably isn't necesary. You can use `#to_s(2)` to achieve the same result.

``` ruby
3.to_s(2).rjust(8, '0')
```

---

Simple:

``` ruby
3.to_binary # => "00000011"
```