Project

General

Profile

Actions

Bug #9858

closed

Ruby math error

Added by Antiokus314 (Navneet Garg) about 11 years ago. Updated about 11 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
2.1.1
[ruby-core:62706]

Description

While in IRB session or executing as a script, when performing the sum
21.1 + 7.6
the output is
28.700000000000003
not
28.7


Files

ruby_math.rb (40 Bytes) ruby_math.rb Math error Antiokus314 (Navneet Garg), 05/22/2014 09:00 PM

Updated by nobu (Nobuyoshi Nakada) about 11 years ago

  • Description updated (diff)
  • Status changed from Open to Rejected

google "floating point error faq".

Actions

Also available in: Atom PDF

Like0
Like0