class Maxima::Float

Constants

ZERO

Attributes

real[RW]

Public Class Methods

new(real = nil, **options) click to toggle source
Calls superclass method
# File lib/maxima/float.rb, line 12
def initialize(real = nil, **options)
  options[:maxima_output] ||= real&.to_s
  super(**options)
  @real = (real || @maxima_output).to_f
end

Public Instance Methods

<=>(other) click to toggle source
# File lib/maxima/float.rb, line 18
def <=>(other)
  case other
  when ::Float, Float
    @real <=> other.to_f
  else
    -1
  end
end
derivative(v: nil) click to toggle source
# File lib/maxima/float.rb, line 39
def derivative(v: nil)
  ZERO
end
imaginary?() click to toggle source
# File lib/maxima/float.rb, line 35
def imaginary?
  false
end
real?() click to toggle source
# File lib/maxima/float.rb, line 31
def real?
  true
end
to_f() click to toggle source
# File lib/maxima/float.rb, line 27
def to_f
  @real
end