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. Except explicit open source licence (indicated Creative Commons / free), the "Euclidean Division" algorithm, the applet or snippet (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or the "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.) and all data download, script, or API access for "Euclidean Division" are not public, same for offline use on PC, mobile, tablet, iPhone or Android app!
Reminder : dCode is free to use.
The copy-paste of the page "Euclidean Division" or any of its results, is allowed (even for commercial purposes) as long as you credit dCode!
Exporting results as a .csv or .txt file is free by clicking on the export icon
Cite as source (bibliography):
Euclidean Division on dCode.fr [online website], retrieved on 2024-12-04,