[MacRuby-devel] [MacRuby] #584: BigMath.sqrt always returns NaN

MacRuby ruby-noreply at macosforge.org
Wed Feb 3 01:53:37 PST 2010


#584: BigMath.sqrt always returns NaN
-------------------------------------+--------------------------------------
 Reporter:  hghoehne@…               |       Owner:  lsansonetti@…        
     Type:  defect                   |      Status:  new                  
 Priority:  major                    |   Milestone:  MacRuby 0.5          
Component:  MacRuby                  |    Keywords:                       
-------------------------------------+--------------------------------------

Comment(by maxime.curioni@…):

 The problem seems to be more of a general difference between ruby 1.8 and
 ruby 1.9, than a MacRuby-specific problem:

 # ruby -v => ruby 1.8.7 (2008-08-11 patchlevel 72) [universal-darwin10.0]
 {{{
 >> require 'bigdecimal/math'
 => true
 >> BigMath.methods.include? :sqrt
 => false
 }}}

 # ruby -v  => ruby 1.9.2dev (2010-01-26 trunk 26419) [i386-darwin10.2.0]
 {{{
 >> require 'bigdecimal/math'
 => true
 >> BigMath.methods.include? :sqrt
 => false
 }}}

 #macruby -v => MacRuby version 0.6 (ruby 1.9.0) [universal-darwin10.0,
 i386]
 {{{
 >> require 'bigdecimal/math'
 => true
 >> BigMath.methods.include? :sqrt
 => false
 }}}

 Since we are aiming to match Ruby 1.9's behavior, this is definitely
 something that should be fixed. In the mean time, users can go around the
 problem by:[[BR]]
 - either adding 'include BigMath' after "require 'bigdecimal/math'"[[BR]]
 - or using the instance method #sqrt on the object (i.e.
 "four.sqrt(10)")[[BR]]

-- 
Ticket URL: <http://www.macruby.org/trac/ticket/584#comment:1>
MacRuby <http://macruby.org/>



More information about the MacRuby-devel mailing list