3
2.302585092994046
6.0
12
6.0
π = 3.1415926535897...
e = 2.7182818284590...
Int64
Float64
64
Uint8
Uint16
1 + 2im
8 + 1im
Char
ASCIIString (constructor with 2 methods)
'B'
"ABC12D"
"TEST3"
ismatch(r"\d{4}-\d\d-\d\d", "2014-08-31")
true
match(r"(\d{4})-(\d\d)-(\d\d)", "2014-08-31")
RegexMatch("2014-08-31", 1="2014", 2="08", 3="31")
function f(x, y)
x + y
end
f(1, 3)
4
3
6
h(x ,y) = x+y, x*y
h(2,3)
(5,6)
7
function pp(x, y=10)
return x * y
end
pp(2)
20
function test1(x, y; a="test2", b="test2")
print("$x, $y, $a, $b\n")
end
test1(1,2)
test1(3,2, b="kk")
1, 2, test2, test2
3, 2, test2, kk
map(x->begin
if x > 10
x^3
else
x^2
end
end
, [2,10,20])
3-element Array{Int64,1}:
4
100
8000
map([2,10,20]) do x
if (x > 10)
x ^ 3
else
x^2
end
end
3-element Array{Int64,1}:
4
100
8000