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, แม้ว่าจะมีตัวเลขทั้งสองเป็นจำนวนเต็มก็ตาม^ยกกำลัง
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คือเศษเหลือ- ในคู่มือนี้เขียน them ระหว่างสองตัวเลข:
17 DIV 5,17 MOD 5 - นั่นไม่ใช่วิธีที่ IGCSE 0478 เขียน them They are functions,
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)ส่งคืนส่วนจำนวนเต็มของ realINT(27.5415)คือ27RAND(n)ส่งคืน real จาก 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.
ไทย
ข้อผิดพลาดที่พบบ่อย
- เขียน
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. · คลิก Run เพื่อดูผลลัพธ์ที่นี่
Output the integer part of 27.5415. · เอาต์พุตส่วนจำนวนเต็มของ 27.5415
Click Run to see the output here. · คลิก Run เพื่อดูผลลัพธ์ที่นี่