这是我应该通过在中创建新方法来实现的规范Fixnum
:
it "reads trillions" do
1_000_000_000_000.in_words.should == 'one trillion'
1_000_000_000_001.in_words.should == 'one trillion one'
1_888_259_040_036.in_words.should == 'one trillion eight hundred eighty eight billion two hundred fifty nine million forty thousand thirty six'
end
问题是,1_000_000_000_000
不被认为是 a Fixnum
,而是 a Bignum
。
我的第一个想法是继续添加新方法Bignum
。
我错过了分配的重点还是有办法强制Fixnum
处理这么大的数字?