-
Notifications
You must be signed in to change notification settings - Fork 415
[NOTES] SUM function
Semseddin Moldibi edited this page Aug 20, 2018
·
1 revision
Simple sum
(and average
) function added to Red. See PR-3498
Currently sum
doesn't coalesce return value as float!
in case of integer overflow. This could be done by a safe
refinement with a cost of performance.
Here you can see a comparison
But we generally do not use that kind of error handling, and add
doesn't have safety too.
Also note that average
always returns float!
value.
It could also be done by a HOF accumulator/fold approach.
Also see @9214's comment
Both Red and Red/System are published under the BSD license. The runtime is published under the BSL license.