mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-21 02:50:14 +08:00
add spec which related fixfloat
This commit is contained in:
@@ -37,4 +37,15 @@ describe "Float" do
|
||||
it "Range#eql?" do
|
||||
(0.5..2.4).eql?(0.5..2.4).should == true
|
||||
end
|
||||
|
||||
it "fixfloat" do
|
||||
# in 32bit env, integral multiple become to fixfloat
|
||||
100.times do |i|
|
||||
i.to_f.__fixfloat__?.should == true
|
||||
end
|
||||
|
||||
0.7.step(100.0, 1.0) do |f|
|
||||
f.__fixfloat__?.should == false
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user