Fix sum and product to start with floating point instead of int

This commit is contained in:
Jonathan Turner 2009-07-03 15:32:58 +00:00
parent b720d85c8b
commit b191d5a2ee

View File

@ -47,8 +47,8 @@ def foldl(container, func, initial) : call_exists(range, container){ \n\
} \n\
retval \n\
} \n\
def sum(container) { foldl(container, `+`, 0) } \n\
def product(container) { foldl(container, `*`, 1) } \n\
def sum(container) { foldl(container, `+`, 0.0) } \n\
def product(container) { foldl(container, `*`, 1.0) } \n\
def take(container, num) : call_exists(range, container) { \n\
var r = range(container); \n\
var i = num; \n\