我需要编写一个算法(我不能使用任何 3rd 方库,因为这是一个分配)来划分(整数除法,浮动部分并不重要)非常大的数字,比如 100 - 1000 位。我找到了http://en.wikipedia.org/wiki/Fourier_division算法,但我不知道这是否是正确的方法。你有什么建议吗?
1) check divisior < dividend, otherwise it's zero (because it will be an int division)
2) start from the left
3) get equal portion of digits from the dividend
4) if it's divisor portion is still bigger, increment digits of dividend portion by 1
5) multiply divisor by 1-9 through the loop
6) when it exceeds the dividend portion, previous multiplier is the answer
7) repeat steps 3 to 5 until reaching to the end