MOD

ページ名:MOD
  • MOD

Remainder = Numerator AS Integer MOD Denominator AS Integer

2つの整数の除算の余りを計算します。

この演算子は、真の数学的法を評価しません。

A MOD B = A - (A DIV B) * B

Examples

Print 9 Mod 4;; -9 Mod 4;; 9 Mod -4;; -9 Mod -4
1 -1 1 -1

 

5による除数の検定

Dim N As Integer
N = 563

If N Mod 5 = 0 Then
Print
"The number " & N & " is divisible by 5"
Else
Print
"The number " & N & " is not divisible by 5"
Endif
The number 563 is not divisible by 5

See also

 

シェアボタン: このページをSNSに投稿するのに便利です。

コメント

返信元返信をやめる

※ 悪質なユーザーの書き込みは制限します。

最新を表示する

NG表示方式

NGID一覧