Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

calculator script #447

Answered by avinashkranjan
divya-gh asked this question in Q&A
Discussion options

I had a question regarding the eval() function in the calculator script. I see that when the previous value is not 0, its value has been assigned with a new calculation result as seen below
eval_operation

My question is, Why are we trying to assign a value to the previous variable?

Challenges:
It was hard to understand what was expected. more documentation needed with expected results.

You must be logged in to vote

I had a question regarding the eval() function in the calculator script. I see that when the previous value is not 0, its value has been assigned with a new calculation result as seen below

My question is, Why are we trying to assign a value to the previous variable?

Challenges:
It was hard to understand what was expected. more documentation needed with expected results.

So That you can continue to do the calculation, In case of a complex calculation or you need to calculate something. So, It assigns the new answer to the variable for convenience else it would not be convenient if you need to remember last answer to calculate next expression.

Replies: 1 comment

Comment options

I had a question regarding the eval() function in the calculator script. I see that when the previous value is not 0, its value has been assigned with a new calculation result as seen below
eval_operation

My question is, Why are we trying to assign a value to the previous variable?

Challenges:
It was hard to understand what was expected. more documentation needed with expected results.

So That you can continue to do the calculation, In case of a complex calculation or you need to calculate something. So, It assigns the new answer to the variable for convenience else it would not be convenient if you need to remember last answer to calculate next expression.

You must be logged in to vote
0 replies
Answer selected by avinashkranjan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /