From mboxrd@z Thu Jan 1 00:00:00 1970 From: wmorgan-sup@masanjin.net (William Morgan) Date: Sat, 08 Dec 2007 14:13:47 -0800 Subject: [sup-talk] Util - Fixnum num_digits is wrong In-Reply-To: <20071203105210.GO1974@durance.shot.pl> References: <1196670157-sup-6857@silver> <20071203105210.GO1974@durance.shot.pl> Message-ID: <1197151959-sup-1679@south> Excerpts from Shot (Piotr Szotkowski)'s message of Mon Dec 03 02:52:10 -0800 2007: > Math.log and Float#/ returning Floats means the above approach is > prone to the IEEE 754 representation inaccuracy. > > Wouldn?t the below make more sense? > > class Fixnum > def num_digits base = 10 > to_s(base).size > end > end Yes, but not as much as simply deleting the method. :) -- William