# Help with function sum{}

**URL:** <https://discourse.julialang.org/t/help-with-function-sum/22128>\
**Category:** Optimization (Mathematical)\
**Tags:** jump\
**Created:** [March 20, 2019, 10:54pm UTC](https://discourse.julialang.org/t/help-with-function-sum/22128 "2019-03-20T22:54:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![danielcas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/danielcas/32/7515_2.png) [@danielcas](https://discourse.julialang.org/u/danielcas)\
**Post date:** [March 20, 2019, 10:54pm UTC](https://discourse.julialang.org/t/help-with-function-sum/22128/1 "2019-03-20T22:54:25Z")

</div>

H, on my file there’s a constraint written like this @NLconstraint(m,-sum{log(x[i])/gamma[i], i=1:n}\<=mm), when I run the program I get an error saying that this type of syntax is no longer supported. so…¿What is the new syntax for sum{} function then? I installed Julia 2 days ago.

Kind regards.

Daniel Castro.

---

<div class="post-metadata">

**Author:** ![longemen3000](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/longemen3000/32/7298_2.png) [@longemen3000](https://discourse.julialang.org/u/longemen3000)\
**Post date:** [March 20, 2019, 11:04pm UTC](https://discourse.julialang.org/t/help-with-function-sum/22128/2 "2019-03-20T23:04:08Z")

</div>

```julia
@NLconstraint (m,-sum{log(x[i])/gamma[i], i=1:n}&lt;=mm)

```

maybe the `{` symbol before sum?, i don´t use JuMP, something like this?

```julia
@NLconstraint (m,-sum(log(x[i])/gamma[i], i=1:n}&lt;=mm)

```

---

<div class="post-metadata">

**Author:** ![longemen3000](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/longemen3000/32/7298_2.png) [@longemen3000](https://discourse.julialang.org/u/longemen3000)\
**Post date:** [March 20, 2019, 11:06pm UTC](https://discourse.julialang.org/t/help-with-function-sum/22128/3 "2019-03-20T23:06:09Z")

</div>

> [@danielcas](#):
>
> H, on my file there’s a constraint written like this @NLconstraint(m,-sum{log(x[i])/gamma[i], i=1:n}\<=mm), when I run the program I get an error saying that this type of syntax is no longer supported. so…¿What is the new syntax for sum{} function then? I installed Julia 2 days ago.

a non related question, that gamma is an activity?

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [March 21, 2019, 2:05am UTC](https://discourse.julialang.org/t/help-with-function-sum/22128/4 "2019-03-21T02:05:30Z")

</div>

`sum{}` is old syntax and has been replaced by `sum()`. You can find the latest JuMP documentation here: [Introduction · JuMP](http://www.juliaopt.org/JuMP.jl/v0.19/)
