Re: Microrant on Ruy's Math Skills

On Fri, Jan 27, 2012 at 8:32 PM, Tony A.
[email protected]wrote:

I think the real path forward here would be to propose that BigDecimal is
loaded by default in Ruby 2.0, and to propose some type of literal
representation for them, such as 1.1D that was suggested before.

+1 , assuming that is 100% backwards compatible with the current code.

It really is nothing more than a “macro” for

xxx.yyyD => BigDecimal.new(“xxx.yyy”)

The thing that stops people from using BigDecimal right now is the
inconvenience of doing BigDecimal(“1.1”), and the output of BigDecimal#to_s
and #inspect is difficult to interpret.

+1

But, I would actually prefer a ‘G’ like notation as default:

http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/391311

HTH,

Peter

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs