Decimal
Umbrella issue to track Decimal.
This new implementation should follow IEEE 754.
@iCharlesHu
If I understand correctly this decimal class should replace the actual Decimal class in the file Decimal+Stub.swift
public struct Decimal : Hashable, Codable, Equatable, CustomStringConvertible {
private let fake: Double
...
}
If it's ok for you, I'd like to start working on this feature. As I intended, the APIs for the class should follow the guidelines reported on this documentation page, while their implementation should follow IEEE 754-2019.
Hi @aestriplex! Thanks for the interest! Unfortunately Decimal is somewhat of a complicated case. The existing Decimal (aka NSDecimal) does not conform to IEEE 754 yet, which means it might be impossible to "port" Decimal as it is without breaking backwards compatibility. This also means most likely the API surface will change and it will have to go through API review.
That being said, could you get started by creating a pitch post on the Swift Form outlining what the new API surface should look like and how do you plan on implement them (what the implementation detail looks like)? We should gather as much info as possible before we proceed to code.
cc @stephentyrone @parkera @lorentey
@iCharlesHu Thanks a lot. I opened a pitch post (https://forums.swift.org/t/decimal-ieee-754-2019/67871)
Resolved in #664 and #735