Project

General

Profile

Actions

Bug #9214

closed

BigDecimal: BigDecimal() and to_d does not always make currect for -0.0

Added by Hanmac (Hans Mackowiak) over 10 years ago. Updated over 10 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.1.0dev (2013-11-28 trunk 43903) [x86_64-linux]
[ruby-core:58858]

Description

BigDecimal does not always works currect for -0.0

BigDecimal("-0.0") => #BigDecimal:1065c88,'-0.0',9(18)
BigDecimal(-0.0,0) => #BigDecimal:10617a0,'0.0',9(27)
(-0.0).to_d => #BigDecimal:10268d0,'0.0',9(36)

i think the problem is related to #8265 because currently there is no nice way to check for -0.0 because equal? can not check it

Actions

Also available in: Atom PDF

Like0
Like0