Class: Numeric

Inherits:
Object show all
Defined in:
lib/rubyhacks.rb

Instance Method Summary collapse

Instance Method Details

#to_mathematica_formatObject



679
680
681
682
683
# File 'lib/rubyhacks.rb', line 679

def to_mathematica_format
    return "0.0" if self.to_f == 0.0
    l = Math.log10(self.to_f.abs).floor
    return "#{self.to_f / 10.0**(l.to_f)}*10^(#{l})"
end