Sandbox:DC: Difference between revisions

From SweepMe! Wiki
Jump to navigation Jump to search
(Test of DC Info template)
 
mNo edit summary
 
Line 1: Line 1:
{{DC_Info
{{DC_Info
|objective=
This function shall add two values and therefore simplify one of the most complex arithmetic operations.
|code=
|code=
def add(self,param1,param2):
def add(self,param1,param2):
Line 9: Line 11:
{{DC_Parameter|param1|The first summand.}}
{{DC_Parameter|param1|The first summand.}}
{{DC_Parameter|param2|The second summand.}}
{{DC_Parameter|param2|The second summand.}}
|objective=
This function shall add two values and therefore simplify one of the most complex arithmetic operations.
|executed=
|executed=
Whenever the program flow detects that a sum is required, this function is called. There is one exception: When the second argument is negative, sub() is called instead.
Whenever the program flow detects that a sum is required, this function is called. There is one exception: When the second argument is negative, sub() is called instead.

Latest revision as of 10:06, 1 December 2017

Objective This function shall add two values and therefore simplify one of the most complex arithmetic operations.
Function Definition
def add(self,param1,param2):
    sum = param1 + param2
    return sum
Parameters
param1: The first summand.
param2: The second summand.
Return value The sum of the two arguments.
When is function called Whenever the program flow detects that a sum is required, this function is called. There is one exception: When the second argument is negative, sub() is called instead.
Comments Actually, this whole function is not used in production.