"for" cycle as a function command
|
11-12-2018, 08:42 PM
(This post was last modified: 11-12-2018 08:49 PM by compsystems.)
Post: #1
|
|||
|
|||
"for" cycle as a function command
Hello
Xcas supports the definition of the "for" cycle as a function command FOR() ;, for many this type of instructions is more compact and readable, as IFTE() function cmd. In the hpprime when writing the following sentences on history view, the system can interpret it. PHP Code: n:=1:; for j from 1 to 5 by 1 do n:=n*j end; n; but the cycle for as a function test_for_2( ) does not. PHP Code: #cas test_for1( ) [enter] returns 120 PHP Code: #cas test_for2( ) |
|||
11-13-2018, 08:44 AM
Post: #2
|
|||
|
|||
RE: "for" cycle as a function command
(11-12-2018 08:42 PM)compsystems Wrote: Hello It's not really a function. It's just syntactic sugar to appease programmers familiar with C-like syntax a little bit. — Ian Abbott |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)