๐ ๋๋ชจ๋ฅด๊ฐ ๋ฒ์น, De Morgan's Law
๐ ๋๋ชจ๋ฅด๊ฐ ๋ฒ์น, De Morganโs Law
not (A or B) = (not A) and (not B)
not (A and B) = (not A) or (not B)
๐ ์ด๋ฅผ ์ด์ฉํด, ์ฝ๊ธฐ ์ข์ ์ฝ๋ ๋ง๋ค๊ธฐ
1
2
3
4
5
// 1
if (!(file_exists && !is_protected))
// 2 (With De Morgan's Law)
if (!file_exists || is_protected)
2๋ฒ ์กฐ๊ฑด๋ฌธ์ด ๋ ์ฝ๊ธฐ ์ฝ๋ค !
์ด ๊ธฐ์ฌ๋ ์ ์๊ถ์์ CC BY 4.0 ๋ผ์ด์ผ์ค๋ฅผ ๋ฐ๋ฆ
๋๋ค.