How I could convert this:
Code: Select all
FOR a = 0 TO 50 STEP .04
...
code
...
NEXTCode: Select all
FOR a = 0 TO 50 STEP .04
...
code
...
NEXTCode: Select all
Define a.f
Repeat
Debug a
a.f+0.04
Until a => 50
Code: Select all
Define a.f
While a < 50.04
Debug a
a.f+0.04
Wend
Code: Select all
Define a.d, da.d
a = 0.0 : da = 0.1
While a <= 2
Debug StrD(a, 3)
a + da
Wend
Debug "---"
a = 0.0 : da = 0.2
While a <= 2
Debug StrD(a, 3)
a + da
Wend
Debug "---"
Code: Select all
Define ia.i, a.d
For ia = 0 To 5000 Step 4 : a = ia / 100.0
; code with "a"
Next
If the goal is to avoid division you could also dojacdelad wrote: Fri Dec 19, 2025 1:57 pm I would prefer the RASHAD version since it avoids the division. But beside speed, both work.
Code: Select all
Define ia.i, a.d
For ia = 100 To 5000 Step 4 : a = ia * 0.01
; code with "a"
NextNo, not on modern CPUs/FPUs. Nowadays, also MUL or FMUL need only a single clock cycle, similar to ADD or FADD.