You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation for Decimal's .nextUp says: "The least representable value that is greater than this decimal." Likewise, Decimal's .nextDown is described as: "The greatest representable value that is less than this decimal."
Perhaps I'm misunderstanding what this means (quite possible!), but that's not at all what these properties seem to do:
Environment
Welcome to Apple Swift version 5.3 (swiftlang-1200.0.29.2 clang-1200.0.30.1).
Additional Detail from JIRA
md5: fdfbbd635e018882b0f40276b46b87b4
relates to:
Issue Description:
The documentation for Decimal's .nextUp says: "The least representable value that is greater than this decimal." Likewise, Decimal's .nextDown is described as: "The greatest representable value that is less than this decimal."
Perhaps I'm misunderstanding what this means (quite possible!), but that's not at all what these properties seem to do:
It's not just my computer being weird, either. There's unit tests which check this: https://github.com/apple/swift/blob/a73a8087968f9111149073107c5242d83635107a/test/stdlib/TestDecimal.swift#L302-L303
Are there not many other representable Decimal values greater than Decimal(2) and less than Decimal(3)? It's just adding 1.0.
The other FloatingPoint types have the same documentation string, and seem to work as advertised:
The text was updated successfully, but these errors were encountered: