Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline Razonar  
#1 Posted : 23 August 2018 09:06:44(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

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).

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline Davide Carpi  
#2 Posted : 23 August 2018 11:01:02(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,639
Man
Italy
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
thanks 1 user thanked Davide Carpi for this useful post.
on 23/08/2018(UTC)
Offline Razonar  
#3 Posted : 23 August 2018 18:22:11(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Originally Posted by: Davide Carpi Go to Quoted Post
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.
thanks 1 user thanked Razonar for this useful post.
on 24/08/2018(UTC)
Users browsing this topic
Similar Topics
Unexpected behavior from some input data (Bugs & Problems)
by Jean Giraud 05/07/2017 20:55:35(UTC)
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.