aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/core/float/finite_spec.rb
blob: c5fb3df849c230feaf673b09b6a9e1db0bcff01a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
require_relative '../../spec_helper'

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