summaryrefslogtreecommitdiff
path: root/spec/rubyspec/core/float/finite_spec.rb
blob: d6a161d4e39d24dbbcac3a76b23e06d153c6b4dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
require File.expand_path('../../../spec_helper', __FILE__)

describe "Float#finite?" do
  it "returns true for finite values" do
    3.14159.finite?.should == true
  end

  it "returns false for positive infinity" do
    infinity_value.finite?.should == false
  end

  it "returns false for negative infinity" do
    (-infinity_value).finite?.should == false
  end

  it "returns false for NaN" do
    nan_value.finite?.should == false
  end
end