Skip to content
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

Implement IsInteger method #179

Merged
merged 1 commit into from Jun 30, 2020
Merged

Implement IsInteger method #179

merged 1 commit into from Jun 30, 2020

Conversation

mwoss
Copy link
Member

@mwoss mwoss commented Jun 28, 2020

This pull request contains an implementation of the IsInteger method that I'm using in WIP implementation of the decimal power method. I'm introducing this functionality in separate PR as new Power implementation would be enough difficult to review and I don't want to hinders it anymore.

I experimented a bit with performance here and I decided to go with the most straight forward implementation (simple abs function, simple checks) as the improvement was almost not visible at all, but they make implementation tricky to understand.

@mwoss mwoss requested a review from njason June 28, 2020 23:41
Copy link
Member

@njason njason left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying to think if there was another short-circuit if statement to check d.value after the d.exp one, but the only one I could think of what when d.value is zero, which I don't think is a big deal to add

@mwoss
Copy link
Member Author

mwoss commented Jun 30, 2020

Yes, it's a pretty rare case. If I would see any performance benefits by introducing this case I would add it along with new Power implementation

@mwoss mwoss merged commit 6fe01c1 into master Jun 30, 2020
@mwoss mwoss deleted the is-integer branch June 30, 2020 23:20
fairyhunter13 added a commit to fairyhunter13/decimal that referenced this pull request Jul 12, 2020
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.

None yet

2 participants