--- title: "system.math.sumDifference" description: "Given two sequences of values, calculates the sum of the signed difference between both sequences." --- # system.math.sumDifference > Given two sequences of values, calculates the sum of the signed difference between both sequences. This function is used in **Python Scripting**. ## Description Given two sequences of values, calculates the sum of each sequence and finds the difference between them. In other words, the difference between sums from two sets of numbers. Throws a DimensionMismatchException if the two sequences have different lengths. ## Client Permission Restrictions This scripting function has no [Client Permission](../../../ignition-modules/vision/vision-project-properties/vision-project-properties.md#vision-permissions-properties) restrictions. ## Syntax `system.math.sumDifference(values1, values2)` ### Parameters Type | Parameter | Description ------- | ------- | ------ List[Float]| `values1` | A sequence of numerical values. Accepts both integers and floats. The sequence may not contain None type values. However, passing a None type object instead of a sequence of numerical values will return NaN. List[Float]| `values2` | A sequence of numerical values. Accepts both integers and floats. The sequence may not contain None type values. However, passing a None type object instead of a sequence of numerical values will return NaN. ### Returns **Float** - The sum difference, or NaN if one of the parameters was empty or null. ### Scope Gateway, Vision Client, Perspective Session ## Code Examples ```python title="Example #1" # Create some lists. firstList = [3.5, 5.6, 7.8, 7.4, 3.8] secondList = [3.5, 5.6, -7.8, 7.4, -3.8] # Print the resulting value. print system.math.sumDifference(firstList, secondList) ```