From: nagachika00@... Date: 2018-02-03T02:39:48+00:00 Subject: [ruby-core:85356] [Ruby trunk Bug#14014] NaN.finite? Issue #14014 has been updated by nagachika (Tomoyuki Chikanaga). Backport changed from 2.3: DONTNEED, 2.4: REQUIRED to 2.3: DONTNEED, 2.4: DONE ruby_2_4 r62173 merged revision(s) 60040,60188. ---------------------------------------- Bug #14014: NaN.finite? https://bugs.ruby-lang.org/issues/14014#change-70140 * Author: marcandre (Marc-Andre Lafortune) * Status: Closed * Priority: Normal * Assignee: * Target version: 2.5 * ruby -v: 2.4.2 * Backport: 2.3: DONTNEED, 2.4: DONE ---------------------------------------- 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: