Class: Numeric

Inherits:
Object
  • Object
show all
Defined in:
lib/pulo/quantity/numeric_overloads.rb

Overview

Cos, Sin and Tan of angles

Instance Method Summary collapse

Instance Method Details

#clamp(min, max) ⇒ Object

[View source]

5
6
7
8
9
10
11
# File 'lib/pulo/quantity/numeric_overloads.rb', line 5

def clamp(min, max)
  if self < min
    min
  else
    self > max ? max : self
  end
end