Project

General

Profile

Actions

Backport #1910

closed

BigDecimal addition inaccuracy 3.6525+24.35 != 28.25

Added by eliotsykes (Eliot Sykes) over 15 years ago. Updated over 13 years ago.

Status:
Closed
Assignee:
-
[ruby-core:24819]

Description

=begin
ruby 1.8.7 (2009-06-08 patchlevel 173) [i686-linux]

I tried this sum and got the answer 28.25 instead of 28.0025:

result = BigDecimal.new("3.6525") + BigDecimal.new("24.35")
puts result.to_f

Prints "28.25" instead of "28.0025"
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0