Accumulator factory: Difference between revisions

Added comment.
(Added comment.)
(Added comment.)
Line 2,154:
=== Fixed accumulator type ===
Argument to the factory function nay be any signed integer, unsigned integer or float.
Argument to the accumulator function must be of the same type.
Result of the accumulator function is also of the same type.
<lang Nim>
Line 2,179:
 
=== Customized number type ===
Argument to the factory function must be "int" or "float" (extension to other types is possible).
Argument of the accumulator function is of the customized type "Number" but may be "int" or "float"
thanks to the converters.
Result of the accumulator function is of type "Number" but will be displayed either as "int" or "float"
according to the actual contents.
<lang Nim>
type
Anonymous user