De Morgan's laws in Ruby
19 Jun 21:20

1st De Morgan’s law

The negation of a disjunction is the conjunction of the negations.

# this
if !a && !b

#  becomes
unless a || b

2nd De Morgan’s law

The negation of a conjunction is the disjunction of the negations.

# this
if !a || !b

#  becomes
unless a && b

Comments

Empty! You must sign in to add comments.