From: nobu.nokada@... Date: 2003-03-22T06:38:35+09:00 Subject: Re: infinite Time (solved) Hi, At Sat, 22 Mar 2003 05:04:59 +0900, ahoward wrote: > > You need to coerce. > > thanks! didn't know Time.coerce existed... No, you need to define it because it doesn't exist. > > Float#> doesn't call <=> due to performance. > > but > > class << INF > include Comparable > ... > end > > should create a '>' correct? Currently, it doesn't because of performance cost. > class << INFINITY > include Comparable > def <=> o;id == o.id ? 0 : 1;end > end > > class << NEGATIVE_INFINITY > include Comparable > def <=> o;self.id == o.id ? 0 : -1;end > end I guess these singletons are unnecessary, since Float already includes Comparable and infinities return correct comparison. -- Nobu Nakada