add codes
This commit is contained in:
12
ch02.jl
12
ch02.jl
@@ -104,6 +104,18 @@ log(x)
|
|||||||
|
|
||||||
# Code showing typical one-line conditional execution expressions
|
# Code showing typical one-line conditional execution expressions
|
||||||
|
|
||||||
|
x > 0 && println(x)
|
||||||
|
|
||||||
|
if x > 0
|
||||||
|
println(x)
|
||||||
|
end
|
||||||
|
|
||||||
|
x > 0 || println(x)
|
||||||
|
|
||||||
|
if !(x > 0)
|
||||||
|
println(x)
|
||||||
|
end
|
||||||
|
|
||||||
x = -7
|
x = -7
|
||||||
x < 0 && println(x^2)
|
x < 0 && println(x^2)
|
||||||
iseven(x) || println("x is odd")
|
iseven(x) || println("x is odd")
|
||||||
|
|||||||
Reference in New Issue
Block a user