From: nobu@... Date: 2017-10-14T01:44:12+00:00 Subject: [ruby-core:83274] [Ruby trunk Bug#14014][Rejected] NaN.finite? Issue #14014 has been updated by nobu (Nobuyoshi Nakada). Status changed from Open to Rejected NaN is not a (either infinite or finite) number, definitely. Also it is not positive nor negative, so its signedness is nonsense too. `Complex(0/0.0, 0).finite?` returns `false` in the trunk already. ---------------------------------------- Bug #14014: NaN.finite? https://bugs.ruby-lang.org/issues/14014#change-67232 * Author: marcandre (Marc-Andre Lafortune) * Status: Rejected * Priority: Normal * Assignee: * Target version: 2.5 * ruby -v: 2.4.2 * Backport: 2.3: UNKNOWN, 2.4: UNKNOWN ---------------------------------------- Ruby gives contradictory answers for NaN: ``` > (0/0.0).finite? => false > Complex(0/0.0, 0).finite? => true ``` Note that `(0/0.0).infinite?` returns `nil`, so the float answer of `false` looks even more wrong. The two solutions I see are either changing `Float#finite?` to return `true` for NaN, or to raise in both cases. I'd lean towards raising in both cases, as NaN can not be said to be finite or infinite -- https://bugs.ruby-lang.org/ Unsubscribe: