m (Created page with "= Crash Course in Scientific Computing = == V. Numbers == <pre> julia> 2^64 # overflow 0 julia> big(2)^64 # big arithmetics 18446744073709551616 </pre> We could also use <t...")
 
m (V. Numbers)
Line 13: Line 13:
  
 
more with https://en.wikibooks.org/wiki/Introducing_Julia/The_REPL
 
more with https://en.wikibooks.org/wiki/Introducing_Julia/The_REPL
 +
 +
ou can initialize an empty Vector of any type by typing the type in front of []. Like:
 +
 +
<pre>
 +
Float64[] # Returns what you want
 +
Array{Float64, 2}[] # Vector of Array{Float64,2}
 +
Any[] # Can contain anything
 +
</pre>
  
 
{{WLP6}}
 
{{WLP6}}

Revision as of 08:17, 17 February 2021

Crash Course in Scientific Computing

V. Numbers

julia> 2^64 # overflow
0

julia> big(2)^64 # big arithmetics
18446744073709551616

We could also use 2^big(64).

more with https://en.wikibooks.org/wiki/Introducing_Julia/The_REPL

ou can initialize an empty Vector of any type by typing the type in front of []. Like:

Float64[] # Returns what you want
Array{Float64, 2}[] # Vector of Array{Float64,2}
Any[] # Can contain anything