Hi,
I read your post for a few times now, however I still can figure out what do you mean by an error.
Perhaps
you should share with us a desired result?!
Arpit Panwar wrote:
You have an infinitive loop for positive length in here.
Arpit Panwar wrote:
Luckily for you, you have a condition which breaks the loop.
In case j is -6, above condition would look like:
length = 5 --> 5 + 1 - 6 = 0pow(2, -6) = 0,015625 --> ((int) 0,015625) => 0
and since: 0 <= 0, the condition is fulfiled.
And the number -6 is the first one in a row, which breaks the loop.
I have to admit that this code snip looks very strange.
I'm still not sure if this was done intentionally or it is perhaps a side effect of a bad day. ;)
Regards,
Rok