- Scilabヘルプ
- Elementary Functions
- bitwise
- Complex
- Discrete mathematics
- elementarymatrices
- Exponential
- Floating point
- Integer representation
- Integers
- matrixmanipulation
- matrixoperations
- searchandsort
- setoperations
- Trigonometry
- &, &&
- extraction
- ind2sub
- insertion
- isempty
- isequal
- modulo
- ndims
- |, ||
- size
- sub2ind
Please note that the recommended version of Scilab is 2026.0.0. This page might be outdated.
See the recommended documentation of this function
modulo
左オペランド符号を有するモジュロm剰余演算
pmodulo
正のモジュロmユークリッド剰余演算
呼出し手順
i = modulo(n,m)
i = pmodulo(n,m)
引数
- m, n
- エンコードされた整数, 実数または多項式の, スカラー, ベクトル, またはハイパー行列 - mおよび- nは, 同じ型である必要があります. yが整数型の場合,(int8およびint16のように) 異なるエンコード長とすることが可能です. どちらもスカラーでない場合、yは同じ大きさとする 必要があります.
- i
- nと同じ型(および整数型)の スカラー, ベクトル, 行列またはハイパー行列.- iは,- mまたは- nの 大きい方の大きさとなります. For polynomials, when all remainders in the array For polynomials, when all remainders in the array- iare constant (degree==0),- iis of type 1 (numbers) instead of 2 (constant polynomials).
説明
modulo は, i= n (modulo m),
            すなわち, nをmで 割った剰余を計算します.
多項式の場合は、pdiv()が使用されます.
数字の場合、
- modulo()は- i = n - m.* int(n./ m)を計算します.- nが負の場合、結果は負(またはヌル)になります. それ以外は肯定的です.
- pmodulo()は,- i = n - |m| .* floor (n ./ |m|)を計算します.答えは正またはゼロとなります.
|  | mが1つ以上の値0を含む場合,modulo(x,m)およびpmodulo(x,m)はゼロ割を発生します.mhが実数型の場合,
            この例外はieee()モードに基づき処理されます.
            エンコードされた整数の場合,常にエラーを発生します. | 
例
n = [1,2,10,15]; m = [2,2,3,5]; modulo(n,m) modulo(-3, 9) modulo(10, -4) pmodulo(-3, 9) pmodulo(10, -6) pmodulo(-10, -6) // エンコードされた整数 modulo( int8(-13), int16(-7)) pmodulo(int8(-13), int16(-7)) modulo( int8(-13), int16([-7 5])) pmodulo(int8(-13), int16([-7 5])) modulo( int8([-13 8]), int16(-7)) pmodulo(int8([-13 8]), int16(-7)) modulo( int8([-13 8]), int16([-7 5])) pmodulo(int8([-13 8]), int16([-7 5])) // ハイパー行列 m = grand(2,2,2,"uin",-100,100) n = grand(2,2,2,"uin",-10 ,10); n(n==0) = 1 modulo(m, 5) pmodulo(m,5) modulo(51, n) pmodulo(51,n) modulo(m, n) pmodulo(m,n) // 多項式 modulo( %z^2+1, %z) pmodulo(%z^2+1, %z)
履歴
| Version | Description | 
| 5.5.0 | エンコードされた整数およびエンコードされた整数または実数の ハイパー行列に拡張されました. | 
| 6.0.2 | Extension to hypermatrices of polynomials. | 
| Report an issue | ||
| << isequal | Elementary Functions | ndims >> |