자료 매번 검색하기 귀찮아서 만든 블로그
Julia - conditional operators 본문
julia> a>0 && println("a is positive!")
a is positive!
julia> b<0 && println("b is negative!")
false
julia> b==3 || println("b is not 3")
b is not 3
a && b : a가 true일 경우에 b를 계산. a가 false인 경우 return 값은 false
a || b : a가 false일 경우에 b를 계산. a가 true인 경우 return 값은 true
참고 문헌
https://riptutorial.com/julia-lang/example/15211/short-circuit-operators-----and---
Julia Language Tutorial => Short-circuit operators: && and ||
Learn Julia Language - Short-circuit operators: && and ||
riptutorial.com
'Julia' 카테고리의 다른 글
Julia - sizehint! (0) | 2022.02.13 |
---|---|
Julia에서 행렬을 1차원 배열로 만들기 (0) | 2022.02.13 |
recipe 사용하기 (0) | 2022.02.09 |
Julia - function 입력값 다루기 (0) | 2022.02.09 |
Julia - VectorOfArray 사용하기 (배열의 배열을 1차원 배열로 변환) (0) | 2021.12.04 |