# one '#' symbole for a one-line comment, equal to // in C/C++#= '#=' + '=#' pair for multi-line comment
similar to '/*'+'*/' pair in C/C++
=### as in java, println(xxx) is equivalent to print(xxx + '\n')######## day 1: Numbersa=1println("a: ",a,",",typeof(a))## Int64 if running on 64-bit CPU, Int32 for 32-bit CPUaa=UInt8(1)# method to convert to a specific typeprintln(a==aa)println(sizeof(a),", ",sizeof(aa))b=3.2println("b: ",b,",",typeof(b))println(sizeof(b))c=1e18println("c: ",c,",",typeof(c))d=0x3fprintln("d: ",d,",",typeof(d))e=0b10println("e: ",e,",",typeof(e))f=0o057println("f: ",f,",",typeof(f))g='x'println("g: ",g,",",typeof(g))println("g-1: ",g-1,",",typeof(g-1))println(g==UInt8('x'))g=convert(UInt8,g)# convert function for converting typesprintln(g==UInt8('x'))h=2+3imprintln("h: ",h,", ",typeof(h))i=0.5fprintln("i: ",i,", ",typeof(i))j=Inf-Infprintln("j: ",j,", ",typeof(j))k=Inf*0println("k: ",k,", ",typeof(k))l=2/0println("l: ",l,", ",typeof(l))m=6//9println("m: ",m,", ",typeof(m))n=bitstring(65535)println("n: ",n,", ",typeof(n))
Below is the output that I got:
Top comments (0)
Subscribe
We're a place where coders share, stay up-to-date and grow their careers.
Top comments (0)