[SR-11514] Decimal.init(_ value: Double)
sometimes yields incorrect value
#3389
Labels
Decimal.init(_ value: Double)
sometimes yields incorrect value
#3389
Attachment: Download
Environment
Apple Swift version 5.1 (swiftlang-1100.0.270.13 clang-1100.0.33.7)
Target: x86_64-apple-darwin18.7.0
Additional Detail from JIRA
md5: 3222b51ace774646727b041f89ba887e
duplicates:
Issue Description:
`Decimal(76.84)` returns 76.84000000000002048 instead.
However `Decimal("76.84")` returns the correct value.
run `swift Decimal.swift` (attached) to check
PS: I think at some point `NSDecimalNumber(value: 76.84) as Decimal` would return the correct value alsoThe text was updated successfully, but these errors were encountered: