Im having problems with dividing large numbers. I have a while loop that divides the number if the index is within the array limits and if its remainder is zero:
while ((i + j*arr[i]) <= lim && arr[i + j*arr[i]] % arr[i] == 0)
arr[i + j*arr[i]] /= arr[i]
end
Im using an array of Int64 on max value of arr[i]<(150*10^6)^2, even changing to Int128 doesnt help,
BigInt is out of the question because it takes too much time.
I dont understand why I get Inexact error inside the loop if it enters only if the remainder is zero.
and typemax(Int64)>max(arr)
here is the full error:
InexactError: Int64(1.8014400929875968e15)
in top-level scope at P-146-Investigating a Prime Pattern:51
in test at P-146-Investigating a Prime Pattern:39
in setindex! at base\array.jl:826
in convert at base\number.jl:7
in Int64 at base\float.jl:710
it seems to happen only after the value in the array is above (90*10^6)^2