From: Aredridel Date: 2004-10-30T05:11:08+09:00 Subject: Re: Rounding error, (100.0 * 9.95).to_i == 994 On Fri, 29 Oct 2004 11:55:10 +0900, trans. (T. Onoma) wrote: > On Thursday 28 October 2004 09:45 pm, Gavin Kistner wrote: > | On Oct 28, 2004, at 3:42 PM, Aredridel wrote: > | > I went about implementing one the other day, a subclass of BigDecimal, > | > and ran into a snag: SubclassOfBigdecimal.new always returns a > | > BigDecimal. It doesn't use initialize and alloc or any equivalent, > | > making subclassing next to impossible. > | > | This may be yet another case where the suggested way of implementing > | the class that is 'mostly a BigDecimal' is to wrap BigDecimal > | instances: > > I take it that BigDeciaml is techincally immutable then. > > Is BigDeciaml an extra lib one has to install? ri seems to know nothing about > it, etc. etc. BigDecimal works by default on my ruby 1.8.2pre2 on PLD. Yes, the class is technically immutable. I see no reason for this to be the case, so I'd love to dive in and ~fix the C code.