Sha256: 4b6df0badfb6aa0f2cc96c33593c12fa6969e6e10f85dcc74153c9cc3700c935

Contents?: true

Size: 609 Bytes

Versions: 1

Compression:

Stored size: 609 Bytes

Contents

= Radix Base Operator

There first version of Radix worked well enough,
but its API was very functional and thus a bit difficult
to read at a glance.

To improve upon this Radix now offers an option operater
API.

  require 'radix'

With it, the #b method extends String and Array classes to
simplify all mulit-base operations.

  r = "1000".b(2) + "2".b(8)
  r.assert == "1010".b(2)
  r.assert == "12".b(8)
  r.assert == "10".b(10)

  r = "AZ42".b(62) + "54".b(10)
  r.assert == "8814596".b(10)

Working with arrays for bases greater than 62.

  r = [100,10].b(256) + "54".b(10)
  r.assert == "25664".b(10)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
radix-1.1.0 qed/radix_operator.rdoc