[Bugs] #2332 UNSP: Trivial divide calculations generate results with rounding errors

Sugar Labs Bugs bugtracker-noreply at sugarlabs.org
Thu Sep 16 12:55:54 EDT 2010


#2332: Trivial divide calculations generate results with rounding errors
------------------------------------------+---------------------------------
    Reporter:  garycmartin                |          Owner:  rwh                        
        Type:  defect                     |         Status:  new                        
    Priority:  Unspecified by Maintainer  |      Milestone:  Unspecified by Release Team
   Component:  Calculate                  |        Version:  Unspecified                
    Severity:  Unspecified                |       Keywords:                             
Distribution:  Unspecified                |   Status_field:  New                        
------------------------------------------+---------------------------------
 Trivial divide calculations are showing rounding errors (tested in
 Calculate-33).

 89 / 100 = 0.890000000
 496 / 100 = 4.95999999

 Trying the same calculations in a terminal with python is fine 89 / 100 =
 0.89, and 496 / 100 = 4.96.

 If I try using multiply instead, the answers are accurate.

 89 * 0.01 = 0.89
 496 * 0.01 = 4.96

-- 
Ticket URL: <http://bugs.sugarlabs.org/ticket/2332>
Sugar Labs <http://sugarlabs.org/>
Sugar Labs bug tracking system


More information about the Bugs mailing list