# Julia Int function

**URL:** https://discourse.julialang.org/t/julia-int-function/86852
**Category:** General Usage
**Tags:** question
**Created:** [September 6, 2022, 6:16pm UTC](https://discourse.julialang.org/t/julia-int-function/86852 "2022-09-06T18:16:36Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Leon6](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leon6/32/205483_2.png) [@Leon6](https://discourse.julialang.org/u/Leon6)
#### Post date: [September 6, 2022, 6:16pm UTC](https://discourse.julialang.org/t/julia-int-function/86852/1 "2022-09-06T18:16:36Z")

</div>

Are there any major changes for the Int function?

This below script worked in previous versions. Now I’m getting lots of errors for the latest version of Julia:  
`Cruise = Int.(TT[:,1]),`

I’m currently on Version 1.7.2

---

<div class="post-metadata">

### Author: ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)
#### Post date: [September 6, 2022, 6:19pm UTC](https://discourse.julialang.org/t/julia-int-function/86852/2 "2022-09-06T18:19:20Z")

</div>

What errors? `Int` only works if the numbers can be actually converted to Integers without loss of precision:

```julia
julia> Int(1.0)
1

julia> Int(1.1)
ERROR: InexactError: Int64(1.1)
Stacktrace:
 [1] Int64(x::Float64)
   @ Base ./float.jl:788
 [2] top-level scope
   @ REPL[62]:1

```

Maybe you want `round` instead:

```julia
julia> round(Int, 1.1)
1

```

I don’t think anything changed here.

---

<div class="post-metadata">

### Author: ![Leon6](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leon6/32/205483_2.png) [@Leon6](https://discourse.julialang.org/u/Leon6)
#### Post date: [September 6, 2022, 6:36pm UTC](https://discourse.julialang.org/t/julia-int-function/86852/3 "2022-09-06T18:36:28Z")

</div>

Many thanks! The round function works much better.
