Rank: Advanced Member Groups: Registered
Joined: 28/08/2014(UTC) Posts: 1,356 Was thanked: 815 time(s) in 516 post(s)
|
Hi. I can not understand why the argument of the last function "disappears" Thanks in advance Alvaro. dec2hex bad.sm (26kb) downloaded 22 time(s). dec2hex bad.pdf (208kb) downloaded 14 time(s).
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,639 Location: Italy Was thanked: 1323 time(s) in 873 post(s)
|
The answer is in dec2bas(x,b). In the third row there is x:(x-m)/b; arguent:something inside the function is a pass-by-reference operation from the function to the argument, hence the behavior (900 becomes 0). If you don't want it, assign x to an internal variable and do all the definition operations on that variable (f.e. z:x -> z:(z-m)/b) Edited by user 24 August 2018 02:51:59(UTC)
| Reason: marked as SOLVED |
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects |
1 user thanked Davide Carpi for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 28/08/2014(UTC) Posts: 1,356 Was thanked: 815 time(s) in 516 post(s)
|
Originally Posted by: Davide Carpi The answer is in dec2bas(x,b).
In the third row there is x:(x-m)/b; arguent:something inside the function is a pass-by-reference operation from the function to the argument, hence the behavior (900 becomes 0).
If you don't want it, assign x to an internal variable and do all the definition operations on that variable (f.e. z:x -> z:(z-m)/b) Tante grazie Davide! I did not know where else I could look for the error, because I thought I had reviewed everything. Best regards. Alvaro.
|
1 user thanked Razonar for this useful post.
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.