Fast Algorithm for Division w/ Remainder - Division Revision

  • Thread starter Thread starter mtanti
  • Start date Start date
  • Tags Tags
    Division Revision
Click For Summary
A fast algorithm for division with a remainder involves using the integer part of the division and the fractional part. For quick calculations on a computer, one can use the formula: Int(x/y) for the quotient and y*Frac(x/y) for the remainder. When using a calculator, simply perform x/y and ignore the decimals for the quotient, then multiply the decimal part by y to find the remainder. For manual calculations, traditional long division methods are recommended. This approach ensures efficient and accurate division with remainders in various contexts.
mtanti
Messages
172
Reaction score
0
Guys I need a fast algorithm to perform division with a remainder. It has to be very fast though...
 
Mathematics news on Phys.org
Something like, x/y could be done like: (where x and y are numbers)

[Int(x/y)]

Then the remainder is: [y*Frac(x/y)]

That'll be pretty much instant (if you want to do it on a computer or something)


If you want to do it with a calculator then just do:

x/y but disregard the decimals

Then to work out the remainder just do:

x/y but disregard the integer before the decimals then multiply them by y


If you want to do it without a calculator then just do it the old fasioned way :)
 
Last edited:
Here is a little puzzle from the book 100 Geometric Games by Pierre Berloquin. The side of a small square is one meter long and the side of a larger square one and a half meters long. One vertex of the large square is at the center of the small square. The side of the large square cuts two sides of the small square into one- third parts and two-thirds parts. What is the area where the squares overlap?

Similar threads

  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 3 ·
Replies
3
Views
19K