# Declaring Int256?

**URL:** <https://discourse.julialang.org/t/declaring-int256/29911>\
**Category:** New to Julia\
**Created:** [October 14, 2019, 8:45pm UTC](https://discourse.julialang.org/t/declaring-int256/29911 "2019-10-14T20:45:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![squirrel](https://avatars.discourse-cdn.com/v4/letter/s/96bed5/32.png) [@squirrel](https://discourse.julialang.org/u/squirrel)\
**Post date:** [October 14, 2019, 8:45pm UTC](https://discourse.julialang.org/t/declaring-int256/29911/1 "2019-10-14T20:45:36Z")

</div>

Julia’s documentation describes how primitive integers are declared here:  
[https://docs.julialang.org/en/v1/manual/types/#Primitive-Types-1](https://docs.julialang.org/en/v1/manual/types/#Primitive-Types-1)

I want to use an Int256, but this throws an error:

```julia
primitive type Int256 <: Signed 256 end
primitive type UInt256 <: Unsigned 256 end
arr = Array{Int128}(undef, 5)

```

I get a pop up saying:

```julia
flipsign not defined for Int256

error(::String, ::String, ::Type) at error.jl:42

no_op_err(::String, ::Type) at promotion.jl:388

flipsign(::Int256, ::Int256) at promotion.jl:418

abs(::Int256) at int.jl:136

split_sign(::Int256) at intfuncs.jl:620

#string#323(::Int64, ::Int64, ::typeof(string), ::Int256) at intfuncs.jl:645

string(::Int256) at intfuncs.jl:638

show(::IOContext{Base.GenericIOBuffer{Array{UInt8,1}}}, ::Int256) at show.jl:589

#sprint#342(::IOContext{Base.GenericIOBuffer{Array{UInt8,1}}}, ::Int64, ::typeof(sprint), ::Function, ::Int256) at io.jl:105

(::getfield(Base, Symbol("#kw##sprint")))(::NamedTuple{(:context, :sizehint),Tuple{IOContext{Base.GenericIOBuffer{Array{UInt8,1}}},Int64}}, ::typeof(sprint), ::Function, ::Int256) at none:0

alignment(::IOContext{Base.GenericIOBuffer{Array{UInt8,1}}}, ::Int256) at show.jl:1791

alignment(::IOContext{Base.GenericIOBuffer{Array{UInt8,1}}}, ::Array{Int256,1}, ::UnitRange{Int64}, ::UnitRange{Int64}, ::Int64, ::Int64, ::Int64) at arrayshow.jl:68

print_matrix(::IOContext{Base.GenericIOBuffer{Array{UInt8,1}}}, ::Array{Int256,1}, ::String, ::String, ::String, ::String, ::String, ::String, ::Int64, ::Int64) at arrayshow.jl:186

```

Why doesn’t this work?

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [October 14, 2019, 8:50pm UTC](https://discourse.julialang.org/t/declaring-int256/29911/2 "2019-10-14T20:50:19Z")

</div>

You have only defined the type, but then you define all the methods that may be needed. Note in particular that the error comes from trying to print the numbers, if you put a semicolon at the end of the line in the REPL

```julia
arr = Array{Int256}(undef, 5);

```

you don’t get any error.
