[MacRuby] #1211: (120 * 0.2).floor should be 24, but MacRuby rounds it down to 23

MacRuby ruby-noreply at macosforge.org
Thu Mar 31 14:09:14 PDT 2011


#1211: (120 * 0.2).floor should be 24, but MacRuby rounds it down to 23
------------------------------------+---------------------------------------
 Reporter:  mrada@…                 |       Owner:  lsansonetti@…        
     Type:  defect                  |      Status:  new                  
 Priority:  blocker                 |   Milestone:                       
Component:  MacRuby                 |    Keywords:                       
------------------------------------+---------------------------------------

Comment(by thibault.ml@…):

 Float operations have never been precise arithmetics.

 It is very possible that the result of (120 * 0.2) is, internally,
 23.9999999999999999, which mean floor clearly is 23.

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



More information about the macruby-tickets mailing list