11-12-2017, 09:19 PM
I know it's not a good idea to change the value of the counter of a "FOR NEXT" loop. But consider :
You get 50. seems logic...
Now try :
You get .... 1. The loop excecutes only once.
Is this a bug or I misunderstand something ?
EDIT : Ohoh ! The bug is only in approx mode ( |R ) .... NEXTPRIME always returns an integer ( 1. NEXTPRIME returns 2 and the loop dont works). With and I->R after NEXTPRIME, it's OK
Code:
« 0.
0. 100. FOR p
1. 'p' STO+
1. +
NEXT
»
You get 50. seems logic...
Now try :
Code:
« 0.
1. 100. FOR p
p NEXTPRIME 'p' STO
1. +
NEXT
»
You get .... 1. The loop excecutes only once.
Is this a bug or I misunderstand something ?
EDIT : Ohoh ! The bug is only in approx mode ( |R ) .... NEXTPRIME always returns an integer ( 1. NEXTPRIME returns 2 and the loop dont works). With and I->R after NEXTPRIME, it's OK