[MacRuby-devel] [MacRuby] #611: Error decoding JSON floating point number

MacRuby ruby-noreply at macosforge.org
Mon Feb 8 20:48:47 PST 2010


#611: Error decoding JSON floating point number
---------------------------------+------------------------------------------
 Reporter:  dj2@…                |       Owner:  lsansonetti@…        
     Type:  defect               |      Status:  new                  
 Priority:  major                |   Milestone:                       
Component:  MacRuby              |    Keywords:                       
---------------------------------+------------------------------------------
 JSON decoding of floating point numbers sometimes loses accuracy. e.g.

 {{{
 '{"http:\/\/www.schneier.com\/blog\/archives\/2010\/02\/10_cartoons_abo.html":
 {"postrank": 8.1, "postrank_color": "#ff883d"}}'
 }}}

 MacRuby
 {{{
 {"http://www.schneier.com/blog/archives/2010/02/10_cartoons_abo.html"=>{"postrank"=>8.09999999999999,
 "postrank_color"=>"#ff883d"}}
 }}}

 Ruby 1.8.7
 {{{
 {"http://www.schneier.com/blog/archives/2010/02/10_cartoons_abo.html"=>{"postrank"=>8.1,
 "postrank_color"=>"#ff883d"}}
 }}}

-- 
Ticket URL: <http://www.macruby.org/trac/ticket/611>
MacRuby <http://macruby.org/>



More information about the MacRuby-devel mailing list