# From Float type to Integer

**URL:** <https://discourse.julialang.org/t/from-float-type-to-integer/65392>\
**Category:** Performance\
**Tags:** convert, float\
**Created:** [July 27, 2021, 5:16pm UTC](https://discourse.julialang.org/t/from-float-type-to-integer/65392 "2021-07-27T17:16:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![juls](https://avatars.discourse-cdn.com/v4/letter/j/ecc23a/32.png) [@juls](https://discourse.julialang.org/u/juls)\
**Post date:** [July 27, 2021, 5:16pm UTC](https://discourse.julialang.org/t/from-float-type-to-integer/65392/1 "2021-07-27T17:16:48Z")

</div>

Hi,

I wanted to obtain integer output instead of float type output from functions:  
floor(4.56), ceil(4.56). I would be glad to know how to obtain integer output for the same.

Also, I read in documentation, interger division is performed using div(x,y) function. Is there any method to obtain integer output from the usually used: x/y (which is used for division in most languages)

Thank You

---

<div class="post-metadata">

**Author:** ![pdeffebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdeffebach/32/10320_2.png) [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)\
**Post date:** [July 27, 2021, 5:18pm UTC](https://discourse.julialang.org/t/from-float-type-to-integer/65392/2 "2021-07-27T17:18:15Z")

</div>

```julia
floor(Int, 4.65)

```

Use `\div` for that operation.

```julia
julia> 100 ÷ 2
50

julia> 100 ÷ 3
33

```
