hi guys, i have an error: attempt to perform an arithmetic on a nil value
it happends when you type a number a9b, where a+b is 7
for example, if you type 196 (this is a9b number, 9 is its middle number and its first and last number when added equal to 7) it throws this error
numbers to replicate the error: 196, 394, 592, 790
if you want to know what i was doing here, it was the reverse and add thing from this video:
attempt to perform arithmetic on a nil value
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: attempt to perform arithmetic on a nil value
The error occurs in line 51 of your code.
It happens when you call the function "rev" on a number that is too large.
If you insert the lines
right before line 51 you will see that the value of cur is "1.595479779756e+14". If you convert it to a string and reverse it, then it contains the plus-sign. An converting this to a number returns nil.
It happens when you call the function "rev" on a number that is too large.
If you insert the lines
Code: Select all
print(cur)
print(rev(cur))
Check out my blog on gamedev
Re: attempt to perform arithmetic on a nil value
can i write the actual full number in any way?
Re: attempt to perform arithmetic on a nil value
I had to look it up myself. Here is the solution: http://stackoverflow.com/questions/1133 ... c-notation
Check out my blog on gamedev
Re: attempt to perform arithmetic on a nil value
much thanks
Who is online
Users browsing this forum: Bing [Bot], Google [Bot], Semrush [Bot] and 1 guest