Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Knowledge required to build your own integer class?

Upon reaching a brick wall with the .Net framework's lack of a BigInteger class (yet), I've decided I'd like to develop my own as an exercise (I realize open source alternatives exist). What hoops do I need to jump through to be able to develop this? Is there any particuliar knowledge pieces that I probably wouldn't have?

edit: side question. Which data type would you use to represent the numbers inside of your new big integer class?

like image 487
Chris Avatar asked Nov 29 '22 06:11

Chris


1 Answers

Arbitrary precision arithmetic?

Edit: To represent your numbers you will probably want a resizeable array of integers.

like image 135
Andy Balaam Avatar answered Dec 05 '22 10:12

Andy Balaam