Clojure

inconsistent numeric comparison semantics between BigDecimal and other Numerics

Details

  • Type: Defect Defect
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: Release 1.4, Release 1.5
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Patch:
    Code and Test

Description

user> clojure-version
{:major 1, :minor 5, :incremental 0, :qualifier "beta1"}
user> (== 2.0 2.0M)
true
user> (== 2 2.0M)
false <-- this one is not like the others
user> (== 2 2.0)
true
user> (== 2N 2.0)
true
user> (== 2 (double 2.0M))
true

It's not clear if this is a bug or an enhancement request, Should BigDecimal's be special in comparason to their smaller equivalents?

Activity

Andy Fingerhut made changes -
Field Original Value New Value
Attachment clj-1118-make-double-equals-true-for-more-bigdecimals-patch-v1.txt [ 11957 ]
Andy Fingerhut made changes -
Attachment clj-1118-make-double-equals-true-for-more-bigdecimals-patch-v2.txt [ 11959 ]
Andy Fingerhut made changes -
Attachment clj-1118-make-double-equals-true-for-more-bigdecimals-patch-v1.txt [ 11957 ]
Andy Fingerhut made changes -
Andy Fingerhut made changes -
Attachment clj-1118-make-double-equals-true-for-more-bigdecimals-patch-v2.txt [ 11959 ]
Andy Fingerhut made changes -
Patch Code and Test [ 10002 ]

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated: