$B$U$J$P$5$s!“$^$D$b$H$5$s!”(B
$B$*JV;v$"$j$,$H$&$4$6$$$^$9!#(B
2011$BG/(B11$B7n(B1$BF|(B22:46 Tadayoshi F. [email protected]:
$BK\5$$GJQ$($kM=Dj$,$“$k$N$J$i!“FCBg$NHs8_49$K$J$j$^$9$N$G!”:#$N$&$A$K(B
$B@Z$j<N$F$?$$>l9g$N?d>)BeBX:v$r7h$a$F(B ( (x/y).round $B$G$9$+$M!)(B) $B!”(B
2.0 $B$+$i7<LX$7$F$*$$$?$[$&$,$$$$$H;W$$$^$9!#(B($B$D$^$j?d>)7A<0$K$J$C$F(B
$B$$$J$$>l9g$K(B warning $B$r=P$9(B)
$B$=$l$O;?@.$G$9!#$3$l$^$G$N;v$r9M$($k$H$“$^$j4|BT$G$-$J$$$G$9$,!#(B
python2 $B$G$d$C$?$h$&$J;v$G$9$,!”(Bruby $B$@$H(B div
$B$r$D$+$($C$F$/$i$$$G$7$g(B
$B$&!#(B
$B$J$k$[$I!#(B
$B!VBe$o$j$K(B Integer#div $B;H$(!W$H$$$&$3$H$J$N$G!“(BInteger#/ $B$,(B
$B8F$P$l$k$?$S!”$b$7$/$O=i$a$F8F$P$l$?;~$@$1$K7Y9p$9$k46$8$G$9$+$M!#(B
$B8D?ME*$K$O!“(BInteger#// $B$H$+JL$N1i;;;R$rF3F~$7$F!”(BInteger#/
$B$OJQ$($J$$(B
$BJ}$,4r$7$$$G$9!#@Z$j<N$F$r4|BT$7$?%3!<%I$r$9$4$/=q$$$F$-$?!#!#!#(B
smalltalk $B$G$O!“(B// $B$,@Z<N$F(B \ $B$,$=$l$NBP$K$J$kM>$j$J$C$F$$$^$9$,!”(B
ruby $B$G$O(B // $B$O@55,I=8=$KHo$k$N$G%@%a$@$H8@$o$l$^$7$?!#$I$C$A$K$7$F$b(B
Integer#/ $B$rJQ$($k;v$K0UL#$,$“$k$N$G!”$=$l$@$C$?$i!“(Bdiv $B$H(B quo
$B$r$D$+$$(B
$B$^$7$g$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