Arithmetic, DIV and MOD · 演算、DIV(整数除算)とMOD(剰余)
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version. · このページには最新のブラウザ(SharedArrayBuffer対応)が必要です。Chrome、Edge、Firefox、Safariを最新バージョンに更新してください。
English
The arithmetic operators
+-*/and^are the ordinary arithmetic operators./gives a real result, even when both numbers are integers.^raises to a power.
日本語
四則演算の演算子
+、-、*、/、^は通常の四則演算演算子です。/は両方の数が整数であっても、実数(real) 結果を返します。^は累乗(原来power)を行います。
OUTPUT 6 + 2
OUTPUT 7 / 2
OUTPUT 2 ^ 10
English
DIV and MOD sit between the numbers
DIVis integer division: how many whole times one number fits into another.MODis the remainder.- In this guide they are written between the two numbers:
17 DIV 5,17 MOD 5. - That is not how IGCSE 0478 writes them. There they are functions,
DIV(17, 5).
日本語
DIVとMODは数値間に配置される
- **
DIV**は整数除算である: 一方の数が他方の数に何回完全に割り切れるかを示す。 MODは余りです。- このガイドでは、これらは2つの数の間に書かれます:
17 DIV 5、17 MOD 5。 - これはIGCSE 0478での表記方法とは異なります。IGCSEでは関数として
DIV(17, 5)と書きます。
English
日本語
OUTPUT 17 DIV 5
OUTPUT 17 MOD 5
English
INT drops the fractional part
INT(x)returns the integer part of a real.INT(27.5415)is27.RAND(n)returns a real from 0 up to, but not including,n. A paper uses it when the result may vary.
日本語
INTは小数点以下を切り捨てる
INT(x)は実数の整数部分を返します。INT(27.5415)は27です。RAND(n)は0以上n未満の実数を返します。結果が変動する可能性がある場合に問題紙で使用します。
OUTPUT INT(27.5415)
English
Common mistakes
- Write
17 DIV 5, notDIV(17, 5), on a 9618 paper. - Use parentheses when the order of a long expression matters.
日本語
よくあるミス
- 9618の問題紙では、
17 DIV 5を使い、DIV(17, 5)は使わないでください。 - 長い式における計算順序が重要な場合は括弧を使用してください。
English
Now you try
- Use
DIV,MODandINT.
日本語
あなたも試してみよう
DIV、MOD、INTを使用してください。
Output 17 DIV 5 and 17 MOD 5, each on its own line. · 17 DIV 5と17 MOD 5を、それぞれ別々の行に出力します。
Click Run to see the output here. · 実行ボタンをクリックして出力を確認してください。
Output the integer part of 27.5415. · 27.5415の整数部分を出力します。
Click Run to see the output here. · 実行ボタンをクリックして出力を確認してください。