Originally Posted by

**elfizia2001** sorry , i apologize.

No problem

Originally Posted by

**elfizia2001** i know that, but what i mean is the conversion of numbers with many digits, lets say 1000 digits for example, i gave 2^512 as an example just to show that computers can not manipulate it using basic operations like addition,multiplication,division...

Here's an example of the grade school long division algorithm in Java.

Code:

public class LongDivis {
public static void main(String[] args) {
String bignum = "1239759239710009257124301243823";
String quotient = longDivis(bignum, 7);
System.out.println(quotient);
}
static String longDivis(String num, int divisor) {
// does *integer division*, ie, discard remainder
// assume string is of an integer (add a check if you want)
int i, curr, remainder = 0, nextdig;
String ret = "";
for(i = 0; i < num.length(); i++) {
curr = Integer.parseInt(num.substring(i, i+1));
curr += 10 * remainder;
nextdig = curr / divisor;
if (ret.length() > 0 || nextdig != 0) ret += nextdig;
remainder = curr % divisor;
}
return ret;
}
}

Note that doing integer division is the same as doing regular division and taking the floor of the result.

Edit: Fixed a dumb bug.