Class: Arrow::Decimal256

Inherits:
Object
  • Object
show all
Defined in:
lib/arrow/decimal256.rb

Instance Method Summary collapse

Instance Method Details

#absObject

Since:

  • 3.0.0



45
46
47
48
49
# File 'lib/arrow/decimal256.rb', line 45

def abs
  copied = dup
  copied.abs!
  copied
end

#abs!Object



42
# File 'lib/arrow/decimal256.rb', line 42

alias_method :abs!, :abs

#negateObject

Since:

  • 3.0.0



54
55
56
57
58
# File 'lib/arrow/decimal256.rb', line 54

def negate
  copied = dup
  copied.negate!
  copied
end

#negate!Object



51
# File 'lib/arrow/decimal256.rb', line 51

alias_method :negate!, :negate

#to_sString #to_s(scale) ⇒ String

Overloads:

  • #to_sString

    Returns The string representation of the decimal.

    Returns:

    • (String)

      The string representation of the decimal.

  • #to_s(scale) ⇒ String

    Returns The string representation of the decimal including the scale.

    Parameters:

    • scale (Integer)

      The scale of the decimal.

    Returns:

    • (String)

      The string representation of the decimal including the scale.

Since:

  • 3.0.0



34
35
36
37
38
39
40
# File 'lib/arrow/decimal256.rb', line 34

def to_s(scale=nil)
  if scale
    to_string_scale(scale)
  else
    to_s_raw
  end
end

#to_s_rawObject



20
# File 'lib/arrow/decimal256.rb', line 20

alias_method :to_s_raw, :to_s