[#144] Another implementation of Bignum — "Dmitry Antipov" <dmitry.antipov@...>

Hello Ruby hackers,

15 messages 2002/06/06

Re: Another implementation of Bignum [tarball attached]

From: matz@... (Yukihiro Matsumoto)
Date: 2002-06-07 09:07:08 UTC
List: ruby-core #152
Hi,

In message "Re: Another implementation of Bignum [tarball attached]"
    on 02/06/07, "Dmitry Antipov" <dmitry.antipov@mail.ru> writes:

|see README in attached tarball.

In README:

>- Fixnum / Bignum if (Fixnum > 0, Bignum < 0) or (Fixnum < 0, Bignum > 0)
>  yields -1 with default implementation and 0 with GMP.
>- [basic:330] and [basic:331] yields -1145028200524296336274979403685093706\
>  715775939015 with default implementation and -11450282005242963362749794036\
>  85093706715775939014 with GMP (difference by 1 in last significant digit).
>  Bc yields -1145028200524296336274979403685093706715775939014, so I think
>  this is Ruby error.
>- [basic:362] and [basic:363] yields -2435302482566751480 with default
>  implementation and -2435302482566751479 with GMP (difference by 1 in last
>  significant digit). Yet another Ruby error ?

This is round-up difference.  Ruby (and Python) use floor.  GMP
probably uses truncate.  Try "10/-3".

							matz.

In This Thread