I know I am reinventing the wheel. But I'm really interested in implementing arbitrary precision numbers (integers, rationals, complex, etc) in C or C++ and their algorithms. Please be patient.
My question: How should I approach the process of implementation (and testing) of arbitrary-precision numerical algorithms in C or C++? I don't want to dive right in without a strategy and ultimately see my project fail.
I'll appreciate advice on the following questions: What foundation to base my code on? What sort of structure should I try to apply to the project? Any other general advice for me?
Here are a few obvious questions out of the way:
Why C or C++? Why not stick to Java?
I want to make my implementations as fast as possible without sacrificing too much readability. I plan on keeping things modular and maintainable.
I wanted to be as close as possible to the machine so I plan to step out of my comfort zone: Java and learn C and/or C++ for a change. I have most of the syntax down, now I just need to pick up the best practices and conventions. I hope this project will help me to learn C and/or C++ as well.
Why do you want to do that? There are lots of libraries out there. Use them.
That's not really my objective. I want to gain experience in the field of implementation of numerical algorithms. I'll graduate high school this April and I want to be a researcher in the field of Computer Science. One of the things that have constantly fascinated me is the vast number algorithms for doing the most basic mathematic operations: basic general arithmetic. I want to get into the details of the algorithms. I am willing to mathematically analyse my implementations because I can and I want to.
It's not the destination; it's the journey I'm after.
Who is the end user of your project?
Anyone who wants to use a fast, safe and stable arbitrary precision library (for whatever purposes, from cryptography to language design). I'll make the project open source, so other people (researchers, developers) can refer to my implementation. I'm not planning to make money off of it (directly at least).
What are you planning to do after that?
I will build on my project, maybe try adding multi-threaded support for various operations. I will probably use this in my thesis (long way to go before that).
I don't think anyone else will be interested in this.
That's okay. I'll work on it alone.