hippy
Ex-Staff (retired)
4.1.14, target PICAXE-08
Has something changed in the way symbol constants are calculated or handled ? It used to be possible to use 32-bit intermediate constants, but that doesn't seem to be working any more ...
- SYMBOL X = 120
- SYMBOL TEN = 10
- SYMBOL X_TIMES_1000 = X * 1000
- SYMBOL RESULT = X_TIMES_1000 / TEN
- PAUSE 5000
- SEROUT 0,N2400,("RESULT=",#RESULT,CR,LF)
That should print "12000" but instead prints "5446" - That seems to be as a result of X*1000 being truncated to 16-bits.
Has something changed in the way symbol constants are calculated or handled ? It used to be possible to use 32-bit intermediate constants, but that doesn't seem to be working any more ...
- SYMBOL X = 120
- SYMBOL TEN = 10
- SYMBOL X_TIMES_1000 = X * 1000
- SYMBOL RESULT = X_TIMES_1000 / TEN
- PAUSE 5000
- SEROUT 0,N2400,("RESULT=",#RESULT,CR,LF)
That should print "12000" but instead prints "5446" - That seems to be as a result of X*1000 being truncated to 16-bits.