# Interger Division

**URL:** <https://discourse.julialang.org/t/interger-division/36171>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [March 19, 2020, 1:51am UTC](https://discourse.julialang.org/t/interger-division/36171 "2020-03-19T01:51:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lee](https://avatars.discourse-cdn.com/v4/letter/l/bc8723/32.png) [@Lee](https://discourse.julialang.org/u/Lee)\
**Post date:** [March 19, 2020, 1:51am UTC](https://discourse.julialang.org/t/interger-division/36171/1 "2020-03-19T01:51:29Z")

</div>

I’m trying to divide between two integers, but a Float is returning. I just need an Int return. Any ideas? Appreciate.

---

<div class="post-metadata">

**Author:** ![non-Jedi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/non-jedi/32/3645_2.png) [@non-Jedi](https://discourse.julialang.org/u/non-Jedi)\
**Post date:** [March 19, 2020, 1:59am UTC](https://discourse.julialang.org/t/interger-division/36171/2 "2020-03-19T01:59:59Z")

</div>

See the docstring for `div`. There’s a unicode infix operator for it, too, but I’m too lazy to go copy-paste it for you at the moment.

---

<div class="post-metadata">

**Author:** ![dilumaluthge](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dilumaluthge/32/29283_2.png) [@dilumaluthge](https://discourse.julialang.org/u/dilumaluthge)\
**Post date:** [March 19, 2020, 2:21am UTC](https://discourse.julialang.org/t/interger-division/36171/3 "2020-03-19T02:21:36Z")

</div>

```julia
help?> div

  div(x, y)
  ÷(x, y)

  The quotient from Euclidean division. Computes x/y, truncated to an integer.

```

For example:

```julia
julia> div(10, 2)
5

julia> ÷(10, 2)
5

julia> typeof(div(10, 2))
Int64

julia> typeof(÷(10, 2))
Int64

```

You may also be interested in `//`. However, `//` will return a `Rational`, not an `Integer`.

```julia
julia> 10 // 2
5//1

julia> typeof(10 // 2)
Rational{Int64}

```

---

<div class="post-metadata">

**Author:** ![Lee](https://avatars.discourse-cdn.com/v4/letter/l/bc8723/32.png) [@Lee](https://discourse.julialang.org/u/Lee)\
**Post date:** [March 19, 2020, 2:36am UTC](https://discourse.julialang.org/t/interger-division/36171/4 "2020-03-19T02:36:03Z")

</div>

Thanks!
