From: matz@... (Yukihiro Matsumoto) Date: 2000-01-25T12:58:24+09:00 Subject: [ruby-list:20377] Re: divmod() まつもと ゆきひろです In message "[ruby-list:20370] Re: divmod()" on 00/01/25, Yasushi Shoji writes: |まあ、ややこしいといえば、そうかも‥。でも ruby-man-1.4-jpにも | |> remainder(other) |> selfをotherで割った余りを返します。整数に負の数を含む時、%と値 |> が異なります。 |> |> 13 % 4 => 1 13 % -4 => -3 -13 % 4 => 3 -13 % -4 => -1 |> 13.remainder(4) => 1 13.remainder(-4) => 1 -13.remainder(4) => |> -1 -13.remainder(-4) => -1 | |って、あるので‥。 #
なのに畳み込まれている...

この挙動はScheme由来です。もちろん、将来の変更について議論す
ることは可能です。