Arithmetic, DIV and MOD · Aritmética, DIV y MOD
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version. · Esta página necesita un navegador reciente (con soporte para SharedArrayBuffer). Por favor, actualiza Chrome, Edge, Firefox o Safari a la última versión.
English
The arithmetic operators
+-*/and^are the ordinary arithmetic operators./gives a real result, even when both numbers are integers.^raises to a power.
Español
Los operadores aritméticos
+-*/y^son los operadores aritméticos ordinarios./da un resultado real, incluso cuando ambos números son enteros.^eleva a una potencia.
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).
Español
DIV y MOD se sitúan entre los números
DIVes la división entera: cuántas veces cabe completamente un número en otro.MODes el resto.- En esta guía se escriben entre los dos números:
17 DIV 5,17 MOD 5. - Ese no es el formato que usa IGCSE 0478. Allí son funciones,
DIV(17, 5).
English
Español
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.
Español
INT elimina la parte fraccionaria
INT(x)devuelve la parte entera de un número real.INT(27.5415)es27.RAND(n)devuelve un número real desde 0 hasta, pero sin incluir,n. Se usa en exámenes cuando el resultado puede variar.
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.
Español
Errores comunes
- Escribe
17 DIV 5, noDIV(17, 5), en un examen 9618. - Usa paréntesis cuando el orden de una expresión larga sea importante.
English
Now you try
- Use
DIV,MODandINT.
Español
Ahora practica
- Utiliza
DIV,MODeINT.
Output · Salida 17 DIV 5 and · y 17 MOD 5, each on its own line. · Salida 17 DIV 5 y 17 MOD 5, cada uno en su propia línea.
Click Run to see the output here. · Haz clic en Ejecutar para ver la salida aquí.
Output the integer part of 27.5415. · Salida la parte entera de 27.5415.
Click Run to see the output here. · Haz clic en Ejecutar para ver la salida aquí.