Project

General

Profile

Actions

Bug #4394

closed

Bug in floating point multiplication

Added by philomath (Stefan Lembach) about 13 years ago. Updated almost 3 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.2p136 (2010-12-25 revision 30365) [x86_64-linux]
[ruby-core:35222]

Description

I stumbled upon the following odd rounding error in Float multiplication while using irb to calculate the tip for the pizza service ;-):

12.4 * 1.05 yields 13.020000000000001, but should be 13.02


Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #3746: Incorrect Float subtractionRejected08/26/2010Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0