I have a problem with function and i don't understand why it happen. The problem is: i have a big number, but when i'm trying to make some operations of division - I have zeros. The code is:
for {
fmt.Println("number is", number)
// key := number % 10
key := number.Mod(number, big.NewInt(10))
fmt.Println("key", key)
// number = number / 10
first := new(big.Int).Div(number, big.NewInt(10))
fmt.Println("first ", first)
number = first
fmt.Println(number) //number = 0 always as a fisrt variable too
... }
The example of exit is:
number is 6689502913449127057588118054090372586752746333138029810295671352301633557244962989366874165271984981308157637893214090552534408589408121859898481114389650005964960521256960000000000000000000000000000
key 0
first 0
0
Number is getting on correnctly, Mod operation is seems correctly too. Div operation is not. What the point is? How can i calculate basic divisions of big numbers?