hello, i have been trying to work on a division algorithm for numbers which have digits greater than 8. The solution i came up with was using character arrays and succesive subtraction but unfortunately its not efficient enough. Can anyone please help me find a more elegant solution?
A Division Problem
Collapse
X
-
Tags: None
-
You can't use a double? That has 15 significant figures. Or a long double? That has about 30 significant fugures. -
I think I don't understand your question; do you mean numbers such as 9999 ... 99?Originally posted by aditya sriramhello, i have been trying to work on a division algorithm for numbers which have digits greater than 8. The solution i came up with was using character arrays and succesive subtraction but unfortunately its not efficient enough. Can anyone please help me find a more elegant solution?
(all digits greater than 8)?
kind regards,
JosComment
-
oh, sorry about the misconception, i meant that the program should be able to take numbers having more than 9 digits, and doubles and long doubles also have their limits, we are trying to work on an alogorithm for numbers which contain upto 100 digits. for eg. 123456789876543 21/5Comment
-
Ah, ok, I understand now; sorry for being thick. Google for "big integer C"; thereOriginally posted by aditya sriramoh, sorry about the misconception, i meant that the program should be able to take numbers having more than 9 digits, and doubles and long doubles also have their limits, we are trying to work on an alogorithm for numbers which contain upto 100 digits. for eg. 123456789876543 21/5
are a lot of free big integeger arithmetic packages out there. There's no need to
write your own (unless that's what your assignment/homework told you to do).
kind regards,
JosComment
Comment