Do anyone have any alternatives to long division? Normally I would find a quotient for something like 540028/1272 by using long division. Is there a better or another way?
Thanks
Printable View
Do anyone have any alternatives to long division? Normally I would find a quotient for something like 540028/1272 by using long division. Is there a better or another way?
Thanks
Calculators ;)
What would be better? Do you mean faster? You might force it to floating points, now that Pentium chips do floating point division faster than integer division. Otherwise, you might just estimate, but then you deal with acceptable error. If you are very tolerant of error, the answer is always 1 or 0.
Yes, I meant faster. I guess the only way to get the correct answer efficiently is long division. Thanks.
I'm not sure if this will do anything, but you might want to try multiplying by the reciprocal instead of dividing. It may be faster. Just guessing though.
If you can get the reciprocal without division, then multiplication would be faster, though only slightly on floating point.
If you are dividing by powers of 2, you can use bit shifting, which would be much faster, but that is a highly restricted solution. Still, x/4 + x/2 will be faster than 3x/4 if you use bit shifting.