# Re: [racket-users] Long division algorithm in HtDP way

```> On Sep 7, 2017, at 9:28 AM, jaroslaw.mo...@gmail.com wrote:
>
>
> Dear Racketeers!
>
> I would like to write the function divide in racket, for performing the long
> division, which would print the whole computational process, as the
> elementary school pupils do. For example, the call (divide 5432, 12) should
> print this:
>
> 5432 : 12 = 452
> -48
> --
>  63
> -60
>  --
>   32
>  -24
>   --
>    8
>    =```
```
Sounds like fun!

If I were you, I would separate this into two problems.

1) given the divisor and the divisee, produce a “trace” of the division.
2) given a “trace”, produce a (single multi-line) string representing it.

Most of the thinking will be in developing the data definition for the “trace.
” Once this is done, the rest should be pretty straightforward.

John Clements

--
You received this message because you are subscribed to the Google Groups
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email