Post Reply 
Existing CAS commands --> Prime discussion
11-08-2019, 10:59 AM
Post: #72
RE: Existing CAS commands --> Prime discussion
(11-08-2019 08:12 AM)ijabbott Wrote:  
(11-08-2019 01:00 AM)toml_12953 Wrote:  No, it doesn't. It increments a temporary copy of a, not a itself. That's why you have to store the result back to the variable a yourself.

a:=increment(a,1)

In Xcas, increment(a,1) gets turned into a+=1, incrementing a in place.

Really? On Prime when I try it, it does this:

I type a:=5
Prime shows 5
I type increment(a,1)
Prime shows increment(5,1)
I type a
Prime shows 5

Prime has not incremented a.

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Existing CAS commands --> Prime discussion - toml_12953 - 11-08-2019 10:59 AM



User(s) browsing this thread: 1 Guest(s)