From: prijutme4ty@... Date: 2014-12-24T19:24:55+00:00 Subject: [ruby-core:67105] [ruby-trunk - Feature #10641] [Open] Introduce Fixnum#finite? Issue #10641 has been reported by Ilya Vorontsov. ---------------------------------------- Feature #10641: Introduce Fixnum#finite? https://bugs.ruby-lang.org/issues/10641 * Author: Ilya Vorontsov * Status: Open * Priority: Normal * Assignee: * Category: core * Target version: ---------------------------------------- Hello, I propose to introduce Fixnum#finite? and Bignum#finite? methods. Use case for this is following: Interval = Struct.new(:from, :to) do def finite? from.finite? && to.finite? end end # this works Interval.new(1.5, 1000.0).finite? Interval.new(1.5, Float::INFINITY).finite? # but this fails due to absence of Fixnum#finite? Interval.new(1, 3).finite? Interval.new(1, Float::INFINITY).finite? It looks natural that Fixnum#finite? should always return true. I didn't worked extensively with Bignum-s, but probably Bignum#finite? should also always be true. -- https://bugs.ruby-lang.org/