How does this method get exp
Code:i += i; e = (i < 0 ? e*2+1 : e*2); i += i; e = (i < 0 ? e*2+1 : e*2); i += i; e = (i < 0 ? e*2+1 : e*2); i += i; e = (i < 0 ? e*2+1 : e*2); i += i; e = (i < 0 ? e*2+1 : e*2); i += i; e = (i < 0 ? e*2+1 : e*2);
How does this method get exp
Code:i += i; e = (i < 0 ? e*2+1 : e*2); i += i; e = (i < 0 ? e*2+1 : e*2); i += i; e = (i < 0 ? e*2+1 : e*2); i += i; e = (i < 0 ? e*2+1 : e*2); i += i; e = (i < 0 ? e*2+1 : e*2); i += i; e = (i < 0 ? e*2+1 : e*2);
Last edited by Zooks; 11-17-2022 at 06:27 AM.
What are you taking about?
"get exp of i "
ie
ei
2i
Something else?
Where is your test code showing how you drive the code?
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
i is a number how does this work
Really!?
Where did you find this code?
And why did you edit the number of iterations from 8 to 6?
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
i am trying to understand why i is added to i.
i wrote a comment how it works but i deleted it i cant recall how it works anymore.
Adding a number to itself is the same as multiplying by 2.
I've no idea what the "i < 0" is supposed to achieve. Nothing being done to i is going to change it's sign.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.