I'm creating my own Bigint class in which large numbers, up to 256 digits long, are placed into an array digit by digit. The array is right-aligned, so the smallest digit is in position 255, and the rest is filled with zeroes that are skipped over when the number is output. I've manged to implement ways of handling the addition, subtraction and multiplication of arbitrary large numbers, but I'm lost as to how I would implement division in a similar fashion.
I attempted to use a repeated subtraction method, but it's just way too slow. Is there an optimal method to handle something like this?
Thanks
Aucun commentaire:
Enregistrer un commentaire