Sha256: 65a6bd06f346a180311da85492f36ac07062d08f290fd66b215396d9afc711fa

Contents?: true

Size: 203 Bytes

Versions: 1

Compression:

Stored size: 203 Bytes

Contents

# frozen_string_literal: true

# mathn/complex
module Math::N
  refine ::Complex do
    def canonicalize
      if imag.zero?
        real.canonicalize
      else
        self
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mathn-0.2.0 lib/mathn/complex.rb