Millie Smith
Millie Smith

Reputation: 4604

Julia default numeric types

I opened the Julia REPL for the first time today. I have a 32-bit installation of Julia and 64-bit installation of Windows. The default integer type is Int32 and the default floating point type is Float64.

#these throw type assertion errors
(1 + 2)::Int64
(1.0 + 2.0)::Float32

#these work
(1 + 2)::Int32
(1.0 + 2.0)::Float64

Why is the default for integers 32-bit and the default for floating points 64-bit on my system?

Upvotes: 2

Views: 713

Answers (1)

StefanKarpinski
StefanKarpinski

Reputation: 33249

Floating-point register sizes have nothing to do with your architecture word size – 64-bit floating-point registers have been available on 32-bit systems since the 8087. See this recent julia-users discussion on the subject: https://groups.google.com/forum/#!topic/julia-users/1tDvMbfCUEE.

Upvotes: 4

Related Questions