hello ,
i am trying to do a counter for some problem I am having, but while I was testing I see that Julia was returning negative numbers after some time,
I have no idea why this is happening,
now to check that, i have added print with condition that 'weird limit has hit,
is this a bug ,
adding the counter code
‘’‘function counter(x)
y = 0
for i in 0:x
y=y+x
if y<0
print(i)
return “weird limit hit”
#rint(i)
end
end
print(y)
end
‘’’
execution @time counter(10000000000)
outputs of weird limits
922337203 0.000041 seconds (17 allocations: 368 bytes)
weird limit hit"
execution @time counter(10000000000000)
922337 0.000040 seconds (17 allocations: 368 bytes)
Out[16]:
“weird limit hit”