PropBasic Multiplication
@Bean,
either I make a very stupid mistake or there is something wrong
with multiplication in PropBasic?
either I make a very stupid mistake or there is something wrong
with multiplication in PropBasic?
' ---------------------------------------------------------------------- ' File...... MotCntCtrl.pbas ' Author.... fgvissel 25.09.2011 ' ====================================================================== ' ----- Device Settings ------------------------------------------------ DEVICE P8X32A, XTAL1, PLL16X XIN 6_250_000 tix var long tox var long PROGRAM Start Start: ' setup code watch tix watch tox Main: tix = _FREQ / 1000 'period = 1msec tix = 100.000 tox = tix * 3 '<<<<<<<<<<<<<<<<<<<<<<<< doesn't work? do loop END
Comments
The bug has been fixed, but I don't have a new revision ready yet.
Bean
* 3 -> *1, *2 ok, * 4 ok, *6 -> *2
Fried
I'll check into it.
The mult should not hang for powers of 2 (2, 4, 8, 16, etc).
The mult result may be incorrect for any constant value with 2 bits set.
For now the workaround is to multiply by a variable. You can use__param1 if you are not using it for a subroutine.
Instead of:
Use
Bean