Bignum#to_s(10) broken

e$B$3$s$K$A$O!"$J$+$`$ie(B(e$B$&e(B)e$B$G$9!#e(B

e$B:G6a$Ne(Bbignum.ce$B$NJQ99e(B(rb_big2str0)e$B$G$9$,!"4p?t$,e(B10(e$B!Ae(B15)e$B$N;~$Ke(B
e$B%P%C%U%!$,0l7eB-$j$F$J$$$h$&$G$9!#e(B
e$B7k2L$H$7$FId9f$,DY$l$F$7$^$C$F$$$^$9!#e(B

Index: bignum.c

RCS file: /home/cvs/ruby/bignum.c,v
retrieving revision 1.100.2.26
diff -u -1 -p -r1.100.2.26 bignum.c
— bignum.c 30 Oct 2006 03:24:19 -0000 1.100.2.26
+++ bignum.c 30 Oct 2006 08:41:13 -0000
@@ -647,3 +647,3 @@ rb_big2str0(x, base, trim)
case 10: case 11: case 12: case 13: case 14: case 15:

  • j = j * 241L / 800;
  • j = j * 241L / 800 + 1;
    break;

e$B$=$l$G$O!#e(B

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:29710] Bignum#to_s(10) broken”
on Mon, 30 Oct 2006 17:44:19 +0900, “U.Nakamura”
[email protected] writes:

|e$B:G6a$Ne(Bbignum.ce$B$NJQ99e(B(rb_big2str0)e$B$G$9$,!"4p?t$,e(B10(e$B!Ae(B15)e$B$N;~$Ke(B
|e$B%P%C%U%!$,0l7eB-$j$F$J$$$h$&$G$9!#e(B
|e$B7k2L$H$7$FId9f$,DY$l$F$7$^$C$F$$$^$9!#e(B
|e$B8+$F$J$$$1$Ie(B1.9e$B$be(B?

e$B$=$NDL$j$G$9!#%Q%C%A<h$j9~$_$^$7$?!#e(B

e$B$3$s$K$A$O!"$J$+$`$ie(B(e$B$&e(B)e$B$G$9!#e(B

In message “[ruby-dev:29710] Bignum#to_s(10) broken”
on Oct.30,2006 17:44:19, [email protected] wrote:
| - j = j * 241L / 800;

e$B$H$3$m$G!"$3$Ne(B 241/800
e$B$Oe(Blog10(2)e$B$N6a;[email protected]$H;W$&$N$G$9$,!"$3e(B
e$B$NCM$G$"$k$N$K$O2?$+?<$$M}M3$,$"$k$N$G$7$g$&$+e(B?
e$B$3$N<[email protected]$18+$F9M$($k$H!"MW5a$5$l$k6a;wCM$H$7$F$O!"e(B

  • log10(2) e$B$h$j$OBg$-$/$F!"e(B
  • e$B%*!<%P!<%U%m!<$rCY$i$;$k$?$aJ,;R$,>.$5$$$[$&$,$h$$e(B
    e$B$N$h$&$K;W$($^$9!#e(B

[email protected]$+$i9M$($k$H!"Nc$($Pe(B 146/485
e$B$NJ}$,6a;wCM$H$7$F$OM%$le(B
e$B$F$$$k>e$KJ,;R$,>.$5$$$G$9$7!"e(B87/289 e$B$de(B 28/93
e$B$J$I$b!"6a;wEYe(B
e$B$Oe(B 146/485 e$B$K$o$:$+$K5Z$P$J$$$J$,$i$be(B 241/800
e$B$h$j$O%^%7$G$9e(B
e$B$7!"J,;R$b$0$C$H>.$5$/$J$j$^$9!#e(B

e$B$=$l$G$O!#e(B

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:29712] Re: Bignum#to_s(10) broken”
on Mon, 30 Oct 2006 18:43:40 +0900, “U.Nakamura”
[email protected] writes:

|In message “[ruby-dev:29710] Bignum#to_s(10) broken”
| on Oct.30,2006 17:44:19, [email protected] wrote:
|| - j = j * 241L / 800;
|
|e$B$H$3$m$G!"$3$Ne(B 241/800 e$B$Oe(Blog10(2)e$B$N6a;[email protected]$H;W$&$N$G$9$,!"$3e(B
|e$B$NCM$G$"$k$N$K$O2?$+?<$$M}M3$,$"$k$N$G$7$g$&$+e(B?
|e$B$3$N<[email protected]$18+$F9M$($k$H!"MW5a$5$l$k6a;wCM$H$7$F$O!"e(B
| * log10(2) e$B$h$j$OBg$-$/$F!"e(B
| * e$B%*!<%P!<%U%m!<$rCY$i$;$k$?$aJ,;R$,>.$5$$$[$&$,$h$$e(B
|e$B$N$h$&$K;W$($^$9!#e(B
|
|[email protected]$+$i9M$($k$H!"Nc$($Pe(B 146/485 e$B$NJ}$,6a;wCM$H$7$F$OM%$le(B
|e$B$F$$$k>e$KJ,;R$,>.$5$$$G$9$7!"e(B87/289 e$B$de(B 28/93 e$B$J$I$b!"6a;wEYe(B
|e$B$Oe(B 146/485 e$B$K$o$:$+$K5Z$P$J$$$J$,$i$be(B 241/800 e$B$h$j$O%^%7$G$9e(B
|e$B$7!"J,;R$b$0$C$H>.$5$/$J$j$^$9!#e(B

e$B$(!<$H!“A4A33P$($F$$$J$$$s$G$,!”$I$3$+$+$i$=$N$^$^;}$C$F$-$?e(B
e$B?tCM$N$h$&$K;W$$$^$9!#$G$b!“e(BGoogle
CodeSearche$B$G$be(BRubye$B$N%=!<e(B
e$B%9$7$+8+$D$+$i$J$$$J!#$h$1$l$P!”$&$5$5$s$NJ}$GCV$-49$($F$$$?e(B
[email protected]$1$^$;$s$+!)e(B

e$B$G$-$k$b$N$J$ie(Bbignum.ce$B$He(Bnumeric.ce$B$K$O?($j$?$/$J$$!#e(B

                            e$B$^$D$b$He(B e$B$f$-$R$me(B /:|)

e$B$3$s$K$A$O!"$J$+$`$ie(B(e$B$&e(B)e$B$G$9!#e(B

In message “[ruby-dev:29713] Re: Bignum#to_s(10) broken”
on Oct.30,2006 18:54:48, [email protected] wrote:
| e$B$(!<$H!“A4A33P$($F$$$J$$$s$G$,!”$I$3$+$+$i$=$N$^$^;}$C$F$-$?e(B
| e$B?tCM$N$h$&$K;W$$$^$9!#$G$b!“e(BGoogle CodeSearche$B$G$be(BRubye$B$N%=!<e(B
| e$B%9$7$+8+$D$+$i$J$$$J!#$h$1$l$P!”$&$5$5$s$NJ}$GCV$-49$($F$$$?e(B
| [email protected]$1$^$;$s$+!)e(B

e$BF~$l$H$-$^$7$?!#e(B
e$B$D$$$G$K!“4p?t$,e(B3e$B$N;~$NE[$b85!9$NJs9p$HF1$8%P%0$,$”$C$?$N$GD>e(B
e$B$7$F!"$5$i$Ke(Bebane$B$5$s$,8+$D$1$?JL$N6a;wCM$KJQ99$7$F$*$-$^$7$?!#e(B

e$B$3$l$G=>Mh$$h$===?J?t$Ge(B270e$BK|7e$K$J$ke(BBignume$B$Ne(Bto_se$B;~$K%!<%P!<e(B
e$B%U%m!<$7$F$$$?$N$,e(B2300e$BK|7e$/$i$$$O$$$1$k$h$&$K$J$C$?!"$H;W$&e(B
e$B$N$G$9$,!"7e$,$G$+$9$.$F3NG’$G$-$^$;$s$G$7$?e(B orz

e$B$=$l$G$O!#e(B

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs