~ubuntu-branches/ubuntu/lucid/jruby/lucid

« back to all changes in this revision

Viewing changes to lib/ruby/1.9/complex.rb

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Delafond
  • Date: 2009-12-09 17:30:55 UTC
  • Revision ID: james.westby@ubuntu.com-20091209173055-8ffzikq1768gywux
Tags: upstream-1.3.1
ImportĀ upstreamĀ versionĀ 1.3.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
require 'cmath'
 
2
 
 
3
unless defined?(Math.exp!)
 
4
  Object.instance_eval{remove_const :Math}
 
5
  Math = CMath
 
6
end
 
7
 
 
8
def Complex.generic? (other)
 
9
  other.kind_of?(Integer) ||
 
10
  other.kind_of?(Float)   ||
 
11
  other.kind_of?(Rational)
 
12
end
 
13
 
 
14
class Complex
 
15
 
 
16
  alias image imag
 
17
 
 
18
end
 
19
 
 
20
class Numeric
 
21
 
 
22
  def im() Complex(0, self) end
 
23
 
 
24
end