Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.4.1 - 日本語

Change language to:
English - Français - Português - Русский

Please note that the recommended version of Scilab is 2024.0.0. This page might be outdated.
See the recommended documentation of this function

Scilab help >> Elementary Functions > modulo

modulo

対称剰余モジュロm演算

pmodulo

正の剰余モジュロm演算

呼出し手順

i=modulo(n,m)
i=pmodulo(n,m)

パラメータ

n,m

整数

説明

modulo は, i= n (modulo m), すなわち, nmで 割った剰余を計算します(n および m は整数).

i = n - m .* int (n ./ m). ここで, n または mが負の場合, 答えが負となる可能性があります.

pmoduloi = n - |m| .* floor (n ./ |m|) を計算します, 答えは正またはゼロとなります.

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)
Report an issue
<< mini Elementary Functions ndims >>

Copyright (c) 2022-2023 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue Apr 02 17:37:32 CEST 2013