Re: TIB: program speed


[Prev][Next][Index][Thread]

Re: TIB: program speed




>No that is incorrect, at least for my TI-85.
>The If statement was always slower and bigger.
>The true statements were always faster.
>
>A monospaced typeface is recommended for viewing the table.
>----------------------------------------------
>      CONDITION                  CONDITION
>       ALWAYS                     ALWAYS
>       FALSE                      TRUE
>----------------------------------------------
>     :For(X,1,100               :For(X,1,100
>2.4s :If X>100             1.4s :If X<100
>     :X+1->X                    :X+1->X
>     :End                       :End


Did you realy use X in the for statement AND in the "X+1/->/X"?
If so the your times are wrong!  It is half the time because it counted by
2's.  The for( added one then you added one.  each time it went through it
added 2.   try it with this:

:1/->/A                           :1/->/A
:For(X,1,100                      :For(X,1,100
:If A=0                           :If /<>/0
:A+1/->/A                         :A+1/->/A
:End                              :End


This will give acurate results


>
>     :For(X,1,100               :For(X,1,100
>1.8s :X+(X>100->X          1.0s :X+(X<100->X
>     :End                       :End
>
>     :For(X,1,100               :For(X,1,100
>1.8s :X+(X<0->X            1.0s :X+(X>0->X
>     :End                       :End
>----------------------------------------------
>The last two examples show that the test used is irrelevant,
> ie: same time whether you use >,<,>=,<=,<>, or =.
>
>
>Sincerely,
>The Unibomer
>
>Jared Ivey
>Unibomer@Juno.com
>http://www.geocities.com/SiliconValley/Vista/7342
>
>"It's a useless but absolutely vital precaution." -- Unknown
>
>
>_____________________________________________________________________
>You don't need to buy Internet access to use free Internet e-mail.
>Get completely free e-mail from Juno at http://www.juno.com
>Or call Juno at (800) 654-JUNO [654-5866]
>
>


Follow-Ups: