# Numeric (Class)

In: | complex.rb
Parent: | Object

Numeric is a built-in class on which Fixnum, Bignum, etc., are based. Here some methods are added so that all number types can be treated to some extent as Complex numbers.

## Methods

angle arg conj conjugate im imag image polar real

## Public Instance methods

im()

Returns a Complex number `(0,self)`.

[Source]

    # File complex.rb, line 38
      def im
        Complex(0, self)
      end

real()

The real part of a complex number, i.e. self.

[Source]

    # File complex.rb, line 45
      def real
        self
      end

image()

The imaginary part of a complex number, i.e. 0.

[Source]

    # File complex.rb, line 52
      def image
        0
      end

imag()

Alias for image

arg()

See Complex#arg.

[Source]

    # File complex.rb, line 60
      def arg
        if self >= 0
          return 0
        else
          return Math::PI
        end
      end

angle()

Alias for arg

polar()

See Complex#polar.

[Source]

    # File complex.rb, line 72
      def polar
        return abs, arg
      end

conjugate()

See Complex#conjugate (short answer: returns self).

[Source]

    # File complex.rb, line 79
      def conjugate
        self
      end

conj()

Alias for conjugate

[Validate]