Skip to content

Decimal and NSDecimalNumber fixes. #1653

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

spevans
Copy link
Contributor

@spevans spevans commented Aug 5, 2018

  • NSDecimalNumber int/uint getters: Dont convert the Decimal value
    using the doubleValue as this can lose the lower digits for large
    integers which cant be accuately represented as a Double.

  • NSDecimalNumber.isEqual: Dont use as? to cast every value
    to an NSDecimalNumber but test individual types.

  • NSNumber.compare: If the other value is a NSDecimalNumber, upgrade
    self to an NSDecimalNumber to avoid loss of precison in the other
    value.

@spevans
Copy link
Contributor Author

spevans commented Aug 5, 2018

@swift-ci please test

@spevans
Copy link
Contributor Author

spevans commented Sep 29, 2018

@swift-ci please test

- NSDecimalNumber int/uint getters: Dont convert the Decimal value
  using the doubleValue as this can lose the lower digits for large
  integers which cant be accuately represented as a Double.

- NSDecimalNumber.isEqual: Dont use as? to cast every value
  to an NSDecimalNumber but test individual types.

- NSNumber.compare: If the other value is a NSDecimalNumber, upgrade
  self to an NSDecimalNumber to avoid loss of precison in the other
  value.
@spevans
Copy link
Contributor Author

spevans commented Nov 12, 2018

@swift-ci test

1 similar comment
@spevans
Copy link
Contributor Author

spevans commented Nov 13, 2018

@swift-ci test

@spevans spevans closed this Dec 1, 2018
@spevans spevans deleted the pr_nsdecimal_fixes branch December 1, 2018 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant