🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: fj.lang.misc
Article #225

Re: 剰余について

#225
From: MAEDA Atusi
Date: Mon, 16 Mar 1998 00:00
24 lines
1759 bytes
maeda@src.ricoh.co.jp (Kaoru MAEDA) writes:

> Perl5.004で規定?された(regulateされた)ようです。
> 
> man perlopより:
> |     Binary "%" computes the modulus of two numbers.  Given
> |     integer operands $a and $b: If $b is positive, then $a % $b
> |     is $a minus the largest multiple of $b that is not greater
> |     than $a.  If $b is negative, then $a % $b is $a minus the
> |     smallest multiple of $b that is not less than $a (i.e. the
> |     result will be less than or equal to zero).

なるほど。floorの余りを採用したんですね。佐藤さんが最初におっしゃった
mathematically correctな剰余ですね。

たしかに、Perl 5.004ではそういう値を返しますね。Perl 5.003だと、除数
($b)が負の時はむちゃくちゃ^^;。マニュアル見ても

|       Binary "%" computes the modulus of the two numbers.

と書いてあるだけだし。

				前田敦司
Technical Details
Message-ID: <pyp7m5vus5q.fsf_-_@tp560e.sowa.is.uec.ac.jp>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <6eb19n$lv3$1@sunny.njk.co.jp> <pypiupisr63.fsf@tp560e.sowa.is.uec.ac.jp> <MAEDA.98Mar16120755@clksv.src.ricoh.co.jp>

Show Full Headers
Complete Article Headers
X-Google-Language: Japanese,JIS
X-Google-Thread: 10b195,716a868b8fc068f4
X-Google-Attributes: gid10b195,public
X-Google-Thread: 1043e7,d5b2ffa89f827a1d
X-Google-Attributes: gid1043e7,public
From: MAEDA Atusi <maeda@is.uec.ac.jp>
Subject: Re: 剰余について
Date: 1998/03/16
Message-ID: <pyp7m5vus5q.fsf_-_@tp560e.sowa.is.uec.ac.jp>
X-Deja-AN: 334448045
References: <6eb19n$lv3$1@sunny.njk.co.jp> <pypiupisr63.fsf@tp560e.sowa.is.uec.ac.jp> <MAEDA.98Mar16120755@clksv.src.ricoh.co.jp>
Mime-Version: 1.0 (generated by tm-edit 7.103)
Reply-To: maeda@is.uec.ac.jp
Supersedes: <pypafarus88.fsf_-_@tp560e.sowa.is.uec.ac.jp>
Content-Type: text/plain; charset=ISO-2022-JP
Organization: The Univ. of Electro-Communications, Tokyo, Japan
Newsgroups: fj.lang.misc,fj.lang.perl