for a challenge involving the mathematical operator of division

learn more… | top users | synonyms

3
votes
13answers
693 views

Divide Two Numbers Using Long Division

Your challenge is to divide two numbers using long division. The method we used to use in old days of school to divide two numbers. Example here You should NOT use / or any other division operator ...
12
votes
9answers
571 views

Implement arbitrary precision division

Implement a function divide(int a, int b, int c) that prints the base 10 value of a/b. without using any floating point math nor BigInteger/BigDecimal or equivalent libraries whatsoever. At least c ...
4
votes
14answers
953 views

Implement division using only addition

There is a question on the site that asks to implement division without using division. In my case, I am asking you to do the same, but only using addition. What this means is basically: addition is ...
22
votes
39answers
5k views

Divide a number by 3 without using *, /, +, -, % operators

Quoting this question on SO (Spoiler alert!): This question has been asked in an Oracle interview. How would you divide a number by 3 without using *, /, +, -, %, operators? The number ...
6
votes
2answers
426 views

Which Numbers Would Crash this Function?

Which values of x and y will cause a crash with some C compilers? int f(int x, int y) { return (y==0) ? 0 : (x/y); }
12
votes
4answers
922 views

Visualize long division with ASCII art

Write a program that visualizes long division with ASCII art. Input consists of two integers, a numerator and a denominator, using the input format of your choice. Examples: 1234 ÷ 56: ...
13
votes
30answers
2k views

Implement division

Implement a division algorithm in your favourite language which handles integer division. It need only handle positive numbers - but bonus points if it handles negative and mixed-sign division, too. ...