Tool to make an euclidean division from the dividend and the divisor to get the quotient and the remainder.
Euclidean Division - dCode
Tag(s) : Arithmetics
dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!
Euclidean division is an arithmetical operation which associates to two (integer) numbers: the dividend and the divisor (not 0), two others numbers resulting from the division operation: the quotient and the remainder.
It can be calculated by hand with several steps (long division) or directly using a calculator.
The remainder $ r $ is the result of $$ r = a - q \times b $$. It represents what is left after the largest possible divisor multiple has been subtracted from the dividend (the remainder after the sharing).
Example: In the division $ 43/21 $, the quotient equals $ 2 $ and the remainder equals $ 43 - 21 \times 2 = 1 $, indeed $ 43 = 2 \times 21 + 1 $.
The divisor $ b $ is calculated from the other values $$ b = \frac{a - r}{q} $$
The quotient $ q $ is calculated from the other values $$ q = \frac{a - r}{b} $$
In mathematics, the remainder of Euclidean division can be positive or negative, but it is commonly agreed to take the positive remainder. If the remainder obtained is negative, you can add the divisor to it to make it positive by subtracting 1 from the quotient. To obtain a positive remainder, take as quotient $ q-1 $, the remainder is then increased by $ b $.
Example: If $ a = 15, b = 4 $, then is is possible to use $ q = 4, r = -1 $ (negative) because $ b \times q + r = 4 \times 4 - 1 = 15 = a $ but to get a positive remainder, take $ q = ( 4 - 1 ) = 3 $ and then have $ r = 3 $ (positive) and $ b \times q + r = 4 \times 3 + 3 = 15 = a $
An Euclidean division is an entire division, it is not supposed to have decimal places.
However, if the divisor or the dividend has decimal places, it is possible to multiply by 10 the dividend and the divisor as many times as necessary to make it disappear.
Example: 1.2/3 is equivalent to having 12/30
If the division stops at integer numbers (before the decimal point) then it is a Euclidean division, otherwise it is a decimal division.
The name euclidean division comes from Euclid, a mathematician.
This software is not limited, it can calculated with any number, including big numbers with arbitrary precision.
dCode retains ownership of the "Euclidean Division" source code. Any algorithm for the "Euclidean Division" algorithm, applet or snippet or script (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or any "Euclidean Division" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) or any database download or API access for "Euclidean Division" or any other element are not public (except explicit open source licence like Creative Commons). Same with the download for offline use on PC, mobile, tablet, iPhone or Android app.
Reminder: dCode is an educational and teaching resource, accessible online for free and for everyone.
The content of the page "Euclidean Division" and its results may be freely copied and reused, including for commercial purposes, provided that dCode.fr is cited as the source.
Exporting the results is free and can be done simply by clicking on the export icons ⤓ (.csv or .txt format) or ⧉ (copy and paste).
To cite dCode.fr on another website, use the link:
In a scientific article or book, the recommended bibliographic citation is: Euclidean Division on dCode.fr [online website], retrieved on 2025-04-15,