Open parkera opened 1 year ago
It also crashes because of missing functionality.
Decimal(exactly: 0)
Most of the missing functionality was implemented in the open-source version; it was to be synchronized with the Apple version but...well, that hasn't happened. If made part of a new open-source project across all platforms, one can be confident that the missing functionality will not be an issue.
More saliently, though, the Decimal
type pre-dates modern IEEE decimal types, and it is likely that we will want those, so it is wise to consider carefully where the legacy type best fits into the picture.
I remember you mentioning that when I wrote the initial bug. imo, it definitely makes sense to phase out the old legacy Decimal
as I don't see any advantages over the IEEE format. One issue that we all encounter with floating points is that at times it is important to know if a number could accurately be represented when doing arithmetic in order to avoid propagating rounding errors.
Added a discussion in the swift forums here: https://forums.swift.org/t/consider-fate-of-decimal/64708
Decimal
is used by a few core types inEssentials
, but it probably also needs some updates to be a better citizen in Swift. In ObjC it is a C struct, so it would be difficult to share the sources exactly.