Category talk:Wren-complex: Difference between revisions
Content added Content deleted
(→Source code: Removed type aliases and changed Complex.tau to be consistent with Num.tau.) |
m (→Source code: Fixed syntax highlighting.) |
||
Line 9: | Line 9: | ||
===Source code=== |
===Source code=== |
||
< |
<syntaxhighlight lang=ecmascript>/* Module "complex.wren" */ |
||
import "./trait" for Cloneable |
import "./trait" for Cloneable |
||
Line 950: | Line 950: | ||
static sum(a) { a.reduce { |acc, x| acc + x } } |
static sum(a) { a.reduce { |acc, x| acc + x } } |
||
static prod(a) { a[1..-1].reduce(a[0]) { |acc, x| acc * x } } |
static prod(a) { a[1..-1].reduce(a[0]) { |acc, x| acc * x } } |
||
}</ |
}</syntaxhighlight> |