Module: CMath

Defined in:
lib/common/ruby_ext.rb

Overview

I don't really undestand why Ruby 1.9 needs this. It seems that Math gets redefine to CMath at some point. So calling Math.max will fail in 1.9 unless I put these functions in CMath too.

Class Method Summary collapse

Class Method Details

.max(a, b) ⇒ Object


13
14
15
# File 'lib/common/ruby_ext.rb', line 13

def self.max a, b
  a > b ? a : b
end

.min(a, b) ⇒ Object


16
17
18
# File 'lib/common/ruby_ext.rb', line 16

def self.min a, b
  a < b ? a : b
end