source: EcnlProtoTool/trunk/mruby-2.1.1/mrbgems/mruby-numeric-ext/mrblib/numeric_ext.rb@ 439

Last change on this file since 439 was 439, checked in by coas-nagasima, 4 years ago

mrubyを2.1.1に更新

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-ruby;charset=UTF-8
File size: 199 bytes
Line 
1class Numeric
2 def zero?
3 self == 0
4 end
5
6 def nonzero?
7 if self == 0
8 nil
9 else
10 self
11 end
12 end
13
14 def positive?
15 self > 0
16 end
17
18 def negative?
19 self < 0
20 end
21end
Note: See TracBrowser for help on using the repository browser.