# Does the "Int" Type really exist?

**URL:** https://discourse.julialang.org/t/does-the-int-type-really-exist/99205
**Category:** New to Julia
**Tags:** question, type
**Created:** [May 22, 2023, 8:44am UTC](https://discourse.julialang.org/t/does-the-int-type-really-exist/99205 "2023-05-22T08:44:40Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![fer2tdt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fer2tdt/32/47427_2.png) [@fer2tdt](https://discourse.julialang.org/u/fer2tdt)
#### Post date: [May 22, 2023, 8:44am UTC](https://discourse.julialang.org/t/does-the-int-type-really-exist/99205/1 "2023-05-22T08:44:40Z")

</div>

Hi,  
1.- I’m finding the use of type “Int” and “Type{Int}” in some articles and documents,  
2.- also some functions reply “things” when I used “Int” likes argument … but not the same if I use Type{Int} likes argument …  
3.- I can´t find the word “Int” likes a type in the Julia Tree types ( include using the famouse “function showtypetree(T, level=0)”.  
Below there is some code to show the “type Int’ s show”

```julia
println("Excuse me, I would like to know what kind of type is 'Int' and if is the same of 'Type{Int}'" )
println(" ")
#
println("-Concrete Int? and Type{Int} ? ", isconcretetype(Int), " y ", isconcretetype(Type{Int}))
println("-Abstract Int? and Type{Int} ? ", isabstracttype(Int), " y ", isabstracttype(Type{Int}))
println(" .... then please tell me de typeof 'Int'... ",typeof(Int), " and de typeof Type{Int} ... ",typeof(Type{Int}))
println(" ")
#
println("- Does Int equal to ...? ")
println(" Integer, Int, BigInt, Int128, Int64, Int32, Int16, Int8")
for e in [Integer, Int, BigInt, Int128, Int64, Int32, Int16, Int8]
    print(" ", isa(e,Int) )    
end
println(" ")
println(" ")
println("- Does Type{Int} equal to ...?? ")
#println(" Integer, Int, BigInt, Int128, Int64, Int32, Int16, Int8")
println(" Integer, Int, BigInt, Int128, Int64, Int32, Int16, Int8")
for e in [Integer, Int, BigInt, Int128, Int64, Int32, Int16, Int8]
    print(" ", isa(e,Type{Int}) )
end
println(" ")
println(" ")
println("- Subtypes of Int ? ")
#println(" Integer, Int, BigInt, Int128, Int64, Int32, Int16, Int8")
println(" Integer, Int, BigInt, Int128, Int64, Int32, Int16, Int8")
for e in [Integer, Int, BigInt, Int128, Int64, Int32, Int16, Int8]
    print(" ", <:(e,Int) )
end
println(" ")
println(" ")
println("- Subtypes of Type{Int} ? ")
#println(" Integer, Int, BigInt, Int128, Int64, Int32, Int16, Int8")
println(" Integer, Int, BigInt, Int128, Int64, Int32, Int16, Int8")
for e in [Integer, Int, BigInt, Int128, Int64, Int32, Int16, Int8]
    print(" ", <:(e,Type{Int}) )
end

```

---

<div class="post-metadata">

### Author: ![jacobusmmsmit](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jacobusmmsmit/32/217669_2.png) [@jacobusmmsmit](https://discourse.julialang.org/u/jacobusmmsmit)
#### Post date: [May 22, 2023, 8:47am UTC](https://discourse.julialang.org/t/does-the-int-type-really-exist/99205/2 "2023-05-22T08:47:22Z")

</div>

From [the docs](https://docs.julialang.org/en/v1/manual/integers-and-floating-point-numbers/):

> Julia also defines the types `Int` and `UInt` , which are aliases for the system’s signed and unsigned native integer types respectively

```julia
# 32-bit system:
julia> Int
Int32
julia> UInt
UInt32

# 64-bit system:
julia> Int
Int64
julia> UInt
UInt64

```

---

<div class="post-metadata">

### Author: ![fer2tdt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fer2tdt/32/47427_2.png) [@fer2tdt](https://discourse.julialang.org/u/fer2tdt)
#### Post date: [May 22, 2023, 8:57am UTC](https://discourse.julialang.org/t/does-the-int-type-really-exist/99205/3 "2023-05-22T08:57:53Z")

</div>

Thank you, but is this exclusive for Julia on 32 bits system?. Because in my 64 bits system I can use 32 bits type s numbers.

---

<div class="post-metadata">

### Author: ![kellertuer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kellertuer/32/220707_2.png) [@kellertuer](https://discourse.julialang.org/u/kellertuer)
#### Post date: [May 22, 2023, 9:23am UTC](https://discourse.julialang.org/t/does-the-int-type-really-exist/99205/4 "2023-05-22T09:23:28Z")

</div>

I am not 100% what you are referring to with the exclusiveness.

The `Int` type is an easy way to refer to the “usual/natural” integer type per system, as the docs show – it is a `Int32` on 32.bit systems and a `Int64` on 64 bit systems.

You can still – if you want to – use `Int32` wherever you like (but it might be wasting space on 64-bit machines, not completely sure). Or `Int64` (but that might be expensive on 32 bit machines).

---

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [May 22, 2023, 11:11am UTC](https://discourse.julialang.org/t/does-the-int-type-really-exist/99205/5 "2023-05-22T11:11:51Z")

</div>

> [@kellertuer](#):
>
> You can still – if you want to – use `Int32` wherever you like (but it might be wasting space on 64-bit machines, not completely sure). Or `Int64` (but that might be expensive on 32 bit machines).

`Int32` is only 32 bits, even on a 64-bit machine, just like `Int8` is only 8 bits (e.g. when stored in an array). And yes, `Int64` is likely to be slower on a 32-bit machine.

`Int` is the default integer type in Julia, e.g. it is the default type used for [small literal integers](https://docs.julialang.org/en/v1/manual/integers-and-floating-point-numbers/#Integers) like `1`, since it is the widest “fast” integer type. It is also used to represent things like the lengths of arrays (since those can never be larger than `typemax(UInt32)` on a 32-bit system, where the memory addresses are only 32 bits wide, and usually cannot be larger than `typemax(Int32)` … I guess technically a `BitArray` could have length `8 * typemax(UInt32)`, but in practice this is not useful if all of your other data structures are limited).

---

<div class="post-metadata">

### Author: ![fer2tdt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fer2tdt/32/47427_2.png) [@fer2tdt](https://discourse.julialang.org/u/fer2tdt)
#### Post date: [May 22, 2023, 11:46am UTC](https://discourse.julialang.org/t/does-the-int-type-really-exist/99205/6 "2023-05-22T11:46:07Z")

</div>

![Screenshot from 2023-05-22 13-34-42](https://global.discourse-cdn.com/julialang/original/3X/2/0/2000d000f5931bc1eebf10dcd62752474603c58c.png)

OK , I can assume that “Int” is an alias of “Int64” in my system, but then I don 't understand the “isa function” reply as you can see above.  
Julia 1.8.5 “pdf”

 ![Screenshot from 2023-05-22 13-43-48](https://global.discourse-cdn.com/julialang/original/3X/c/1/c1af9c91e7bc1c63c873ab9adde2450d117ba766.png)

---

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [May 22, 2023, 11:55am UTC](https://discourse.julialang.org/t/does-the-int-type-really-exist/99205/7 "2023-05-22T11:55:15Z")

</div>

> [@fer2tdt](#):
>
> then I don 't understand the “isa function” reply as you can see above.

`isa` checks whether something is an _instance_ of a type, not whether it is a subtype:

```julia
julia> 1 isa Int
true

julia> Int isa Int
false

julia> Int isa Type
true

```

Perhaps you are thinking of `<:` (“is a subtype of”):

```julia
julia> Int <: Int
true

julia> Int <: Integer
true

```

---

<div class="post-metadata">

### Author: ![fer2tdt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fer2tdt/32/47427_2.png) [@fer2tdt](https://discourse.julialang.org/u/fer2tdt)
#### Post date: [May 22, 2023, 12:08pm UTC](https://discourse.julialang.org/t/does-the-int-type-really-exist/99205/8 "2023-05-22T12:08:24Z")

</div>

Okey thank you, I understand now what isa is doing.
