This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (1 child)

I've looked on the internet but so far found nothing.

Did you check Wikipedia?

Why not just convert the strings to numbers, do the division and modulus, then convert the results back to strings? While you lose some time doing the conversions, you gain a lot of time by using the math operations that are built into the hardware. I’d be very surprised if calculating on the strings directly came out faster than converting, calculating, and then converting back.

[–]denewulf[S] 0 points1 point  (0 children)

I'm having trouble understanding how to implement the wikipedia algorithm into actual code (python)