Created
September 6, 2016 07:50
-
-
Save evmorov/a8364017be46d963973e033653d92eae to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rspec' | |
require_relative 'unusual_bases' | |
describe '#dec_to_fib' do | |
it { expect(dec_to_fib(16)).to eq(1001000) } | |
it { expect(dec_to_fib(32)).to eq(10101000) } | |
it { expect(dec_to_fib(9024720)).to eq(1010100101010100000010001000010010) } | |
end | |
describe '#fib_to_dec' do | |
it { expect(fib_to_dec(10)).to eq(1) } | |
it { expect(fib_to_dec(1)).to eq(1) } | |
it { expect(fib_to_dec(111111)).to eq(20) } | |
it { expect(fib_to_dec(100000)).to eq(8) } | |
it { expect(fib_to_dec(10110110100111001)).to eq(2868) } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment