Multiply Longs
Beavis3215
Posts: 229
deg30 := speedtix ** $1555_5555 ' speedtix / 360 * 30
I have looked in the help files and on the internet on how to implement this Spin example in C, and there are so many conflicting answers I can't make sense of them.
Can anyone please help?
Comments
This simplifies manually to:
Thankyou
I mean, why set the variable to zero, when you're only going to change it in the next line?
-Phil
Yes, it's redundant in this case. In some other cases (e.g. if the assignment below were conditional) then it would be necessary. spin2cpp is an automatic tool, so sometimes it outputs code that isn't as tidy as a human would write. The C compiler will optimize away the redundant assignment, so I didn't put any particular effort into preventing it.