if a value is a zero or not. : zero « Number « Ruby






if a value is a zero or not.


op = 0
op.zero? # => true
op.nonzero? # => false

 

Related examples in the same category

1.Use if statement to check zero