File tree Expand file tree Collapse file tree 5 files changed +65
-0
lines changed
assets/images/functions/Enum
content/en/functions/Enum Expand file tree Collapse file tree 5 files changed +65
-0
lines changed Original file line number Diff line number Diff line change 1+ \matrix [list=a] {
2+ \node [index=1]; &
3+ \node [index=2]; &
4+ \node [elements between]; &
5+ \node [index=n]; \\
6+ };
7+
8+ \draw [brace] (an.south east) -- (a1.south west);
9+
10+ \draw [->] (last brace) -- +(0, -1)
11+ node [below]
12+ {$ a_1 \cdot a_2 \cdot \dots \cdot a_n = \displaystyle\prod _{i=1}^n a_i$ };
13+
Original file line number Diff line number Diff line change 1+ \matrix [list=a] {
2+ \node [index=1]; &
3+ \node [index=2]; &
4+ \node [elements between]; &
5+ \node [index=n]; \\
6+ };
7+
8+ \foreach \i in {1,2,n}{
9+ \node (fun\i ) [fun, below=.5 of a\i .south];
10+ \draw [->] (a\i .south) -- (fun\i .in);
11+ \draw [->] (fun\i .out) -- +(0, -.5)
12+ node (b\i ) [below] {$ b_{\i }$ };
13+ };
14+
15+
16+
17+ \draw [brace] (bn.south east) -- (b1.south west);
18+
19+ \draw [->] (last brace) -- +(0, -1)
20+ node [below]
21+ {$ b_1 \cdot b_2 \cdot \dots \cdot b_n = \displaystyle\prod _{i=1}^n b_i$ };
22+
Original file line number Diff line number Diff line change 1+ ---
2+ title : product_by/2
3+ url : Enum/product_by/2
4+ ---
5+
6+ Returns the product of all elements of ` enumerable ` .
7+
8+ Raises ` ArithmeticError ` if ` enumerable ` contains a non-numeric value.
9+
10+ {{< figure src="images/functions/Enum/product_by-2.svg" >}}
Original file line number Diff line number Diff line change 1+ ---
2+ title : product_by/2
3+ url : Enum/product_by/2
4+ ---
5+
6+ Maps and computes the product of the given ` enumerable ` in one pass.
7+
8+ Raises ` ArithmeticError ` if ` fun ` returns a non-numeric value.
9+
10+ {{< figure src="images/functions/Enum/product_by-2.svg" >}}
Original file line number Diff line number Diff line change 254254 empty_fallback \\ fn -> raise Enum.EmptyError end
255255 )
256256 end
257+ - name : product/1
258+ signature : |
259+ defmodule Enum do
260+ def product(enumerable)
261+ end
262+ - name : product_by/2
263+ signature : |
264+ defmodule Enum do
265+ def product_by(enumerable, fun)
266+ end
257267 - name : random/1
258268 signature : |
259269 defmodule Enum do
You can’t perform that action at this time.
0 commit comments