Method: Numeric#distance

Defined in:
lib/rust/stats/probabilities.rb

#distance(other) ⇒ Object

Raises:

  • (TypeError)


4
5
6
7
8
# File 'lib/rust/stats/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