Class: Numeric
Instance Method Summary collapse
Instance Method Details
#to_mathematica_format ⇒ Object
668 669 670 671 672 |
# File 'lib/rubyhacks.rb', line 668 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 |