klyn.Application.sum
method
public static sum<T extends AbstractNumber>(values... as T) as T:
Description

Returns the sum of all numeric parameters.

Empty parameters list return 0.

print(sum(10, 20, 30))   # 60

print(sum(10.1, 20.2, 30.3))   # 60.6
Parameters
  • values The read-only list to sum.
Returns

The accumulated total with the same numeric type as the input values.