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.
עברית
הפעולות האריתמטיות
+,-,*,/ו^הן פעולות אריתמטיות רגילות./מחזיר תוצאה ממשי, גם כאשר שני המספרים הם שלמים.^מעלה לחזקה.
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הוא שארית.- במדריך זה הם כתובים בין שני המספרים:
17 DIV 5,17 MOD 5. - כך IGCSE 0478 אינו כותב אותם. שם מדובר בפונקציות,
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. ב exam משתמשים בו כאשר התוצאה עשויה להשתנות.
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.
עברית
טעויות נפוצות
- כתוב
17 DIV 5, ולאDIV(17, 5), על דף 9618. - השתמש בסוגריים כאשר סדר ביטוי ארוך חשוב.
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. · לחץ על הרץ כדי לראות את התוצא כאן.