From transfire at gmail.com Tue Feb 1 09:29:36 2011 From: transfire at gmail.com (Trans) Date: Tue, 1 Feb 2011 06:29:36 -0800 (PST) Subject: [Facets] extending Digest::(MD5|SHA1|...) ? In-Reply-To: Message-ID: <30022996.800.1296570576733.JavaMail.geo-discussion-forums@yqmi40> Cool. I'll have a look the code and see what I can add to Facets. -------------- next part -------------- An HTML attachment was scrubbed... URL: From transfire at gmail.com Tue Feb 1 09:26:37 2011 From: transfire at gmail.com (Trans) Date: Tue, 1 Feb 2011 06:26:37 -0800 (PST) Subject: [Facets] Float.close?(a, b, epsilon=0.0000001) In-Reply-To: <20653950.491.1293153261776.JavaMail.geo-discussion-forums@prje29> Message-ID: <10465498.794.1296570397333.JavaMail.geo-discussion-forums@yqmi40> Thanks for the suggestion. I'm wondering if this is needed in light of Numeric#approx? which is: class Numeric def approx?(x, n=0.01) return(self == x) if n == 0 (self - x).abs <= n end end Does this implementation need improvement? Or do we need something else for Floats like your method? The other question is, how do we choose the default value of epsilon? -------------- next part -------------- An HTML attachment was scrubbed... URL: