![]() |
| サイトマップ | |
|
関数 mod
は、指定した数値を除数で割った時の剰余 (余り) を返します。整数ではない実数の剰余ですので、両方の数値は整数である必要はありません。
mod
(numerator, divisor)
引数 numerator と divisor には、スカラーまたは範囲を指定します。範囲に含まれる欠損値や文字列は無視され、文字列や欠損値として返されます。
0 でない任意の除数 (divisor) に対して、関数 mod
は次式の余りを返します。
mod(x,0)
、すなわち、除数 (divisor) が 0 の場合は、
mod({4,5,4,5},{2,2,3,3})
は、範囲 {0,1,1,2}
を返します。これらは、4÷2, 5÷2, 4÷3, 5÷3 に対する余りです。
The mod function returns the modulus (the remainder from division) for corresponding numbers in numerator and divisor arguments. This is the real (not integral) modulus, so both ranges may be nonintegral values.
mod(numerator,divisor)
The numerator and divisor arguments can be scalars or ranges. Any missing value or text string contained within a range is returned as the string or missing value.
For any divisor ≠ 0, the mod function returns the remainder of
For mod(x,0), that is, for divisor = 0,
x > 0 returns + ∞
x = 0 returns + ∞
x < 0 returns - ∞
The operation mod({4,5,4,5},{2,2,3,3}) returns the range {0,1,1,2}. These are the remainders for 4÷2, 5÷2, 4÷3, and 5÷3.