~ubuntu-branches/ubuntu/trusty/ruby1.9/trusty

« back to all changes in this revision

Viewing changes to lib/complex.rb

  • Committer: Bazaar Package Importer
  • Author(s): Stephan Hermann
  • Date: 2008-01-24 11:42:29 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20080124114229-jw2f87rdxlq6gp11
Tags: 1.9.0.0-2ubuntu1
* Merge from debian unstable, remaining changes:
  - Robustify check for target_os, fixing build failure on lpia.

Show diffs side-by-side

added added

removed removed

Lines of Context:
90
90
def Complex(a, b = 0)
91
91
  if b == 0 and (a.kind_of?(Complex) or defined? Complex::Unify)
92
92
    a
 
93
  elsif a.scalar? and b.scalar?
 
94
    # Don't delete for -0.0
 
95
    Complex.new(a, b)
93
96
  else
94
97
    Complex.new( a.real-b.imag, a.imag+b.real )
95
98
  end