Sum
See javadoc - uk.gov.gchq.koryphe.impl.binaryoperator.Sum
Available since Koryphe version 1.0.0
Calculates the sum of 2 numbers
Examples
Sum
Java
JSON
Full JSON
Python
final Sum sum = new Sum();
{
"class" : "Sum"
}
{
"class" : "uk.gov.gchq.koryphe.impl.binaryoperator.Sum"
}
g.Sum()
Input type:
java.lang.Number
Example inputs:
Input Type | Inputs | Result Type | Result |
---|---|---|---|
java.lang.Long | 20 and 3 | java.lang.Long | 23 |
java.lang.Integer | 300 and 400 | java.lang.Integer | 700 |
java.lang.Double | 0.0 and 3.0 | java.lang.Double | 3.0 |
java.lang.Short | 50 and 50 | java.lang.Short | 100 |
java.lang.Short | 30000 and 10000 | java.lang.Short | 32767 |
java.lang.Integer | -5 and 5 | java.lang.Integer | 0 |
java.lang.Long | 20 and null | java.lang.Long | 20 |