You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yi Zhang edited this page May 29, 2018
·
1 revision
Namespace: CalculatorClassLibrary
Description: Adds arbitrary value to memory value at specified index.
Parameters
Description
key<int>
index of target memory value
value<decimal>
value to add
Returns
Description
void
this method does not return anything
Exceptions
Cause
ArgumentOutOfRangeException
key is not a valid index
OverflowException
addition results in a value larger than decimal.MaxValue
Examples:
//memory values are [1, 3, 5, 7]standardCalculator.MemoryPlus(0,7);//memory values are now [8, 3, 5, 7]standardCalculator.MemoryPlus(1,3);//memory values are now [8, 6, 5, 7]standardCalculator.MemoryPlus(-1,7);//will throw exceptionstandardCalculator.MemoryPlus(0,decimal.MaxValue);//will throw exception