# Questions about syntax

**URL:** <https://discourse.julialang.org/t/questions-about-syntax/6791>\
**Category:** New to Julia\
**Created:** [October 31, 2017, 2:45am UTC](https://discourse.julialang.org/t/questions-about-syntax/6791 "2017-10-31T02:45:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marcom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marcom/32/3779_2.png) [@Marcom](https://discourse.julialang.org/u/Marcom)\
**Post date:** [October 31, 2017, 2:45am UTC](https://discourse.julialang.org/t/questions-about-syntax/6791/1 "2017-10-31T02:45:24Z")

</div>

Below is an implementation to compute Lagrange basis in Lagrange interpolation. I understand what this is supposed to do, but I don’t understand the syntax and I would appreciate some help. Particularly, what is ‘./’ – is it some sort of division? Also, what does the function/method ‘prod()’ do?

function LagrangePoly(x, i, z)

```
L=zeros(size(z))

for j=1:length(z)
    L[j]=prod( (z[j]-x[1:i-1])./(x[i]-x[1:i-1]))*prod( (z[j]-x[i+1:end])./(x[i]-x[i+1:end]))
end

return L

```

end

---

<div class="post-metadata">

**Author:** ![tkoolen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkoolen/32/1603_2.png) [@tkoolen](https://discourse.julialang.org/u/tkoolen)\
**Post date:** [October 31, 2017, 4:37am UTC](https://discourse.julialang.org/t/questions-about-syntax/6791/2 "2017-10-31T04:37:53Z")

</div>

1. [https://docs.julialang.org/en/stable/manual/arrays/#Broadcasting-1](https://docs.julialang.org/en/stable/manual/arrays/#Broadcasting-1)
2. [https://docs.julialang.org/en/stable/stdlib/collections/#Base.prod](https://docs.julialang.org/en/stable/stdlib/collections/#Base.prod). Also, you can type `?prod` in the Julia REPL to get the documentation for `prod`.

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [October 31, 2017, 7:13am UTC](https://discourse.julialang.org/t/questions-about-syntax/6791/3 "2017-10-31T07:13:50Z")

</div>

Please don’t double post, or if you do, at least link to the other discussion [https://stackoverflow.com/questions/47027566/julia-syntax-and-implementation-of-lagrange-polynomials](https://stackoverflow.com/questions/47027566/julia-syntax-and-implementation-of-lagrange-polynomials)
