+ 1
What is happening exactly?
Hey everyone. I‘m a litte lost here... what exactly happens here: d *= arr[x] ? I can‘t figure out the outcome of 4.5 logically :( I‘d be grateful for any advice. https://code.sololearn.com/cyzkRo671Rqc/?ref=app
5 Réponses
+ 4
d*=arr[x] means d=d*arr[x]
so first, d=1*3
then ,d=3*0.5
then,d=1.5*2
then ,d=3*1.5
so finally d=4.5
+ 2
d *= arr[x]
Is same as
d = d * arr[x]
+ 1
Now I get it :) I was confused with the * because I was working with pointers and , well, beginner‘s fault I guess :)
+ 1
Yep, thank you.
0
Look if we assume that s is stands for sign then
X s= Y; will be X = X s Y
Like
X+=y
X-=y
X*=y
X/=y
X%=y
And other bitwise operators