Class: Numeric

Inherits:
Object show all
Defined in:
lib/rust-core.rb,
lib/rust-probabilities.rb

Instance Method Summary collapse

Instance Method Details

#distance(other) ⇒ Object

Raises:

  • (TypeError)


4
5
6
7
8
# File 'lib/rust-probabilities.rb', line 4

def distance(other)
    raise TypeError, "no implicit conversion of #{other.class} into Numeric" unless other.is_a? Numeric
    
    return (self - other).abs
end

#to_RObject



784
785
786
# File 'lib/rust-core.rb', line 784

def to_R
    self.inspect
end