Skip to content

Conversation

@NelsonBN
Copy link
Member

Fix Floating-Point Reliability issue in GeoDDCoordinate

Checklist before requesting a review

  • I have performed a self-review of my code.
  • Implemented tests for new features.
  • I tested the features already implemented.
  • Added usage examples in the readme.

Copilot AI review requested due to automatic review settings August 30, 2025 21:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes floating-point reliability issues in the GeoDDCoordinate class by implementing tolerance-based equality comparison instead of direct double equality comparison.

Key changes:

  • Replaced direct floating-point equality (==) with tolerance-based comparison using Math.Abs() and a tolerance of 1e-12 degrees
  • Updated GetHashCode() implementation to ensure consistency with tolerance-based equality by normalizing values
  • Added comprehensive test suite to verify floating-point precision handling

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
GeoDDCoordinateTests.cs Updated namespace to match directory structure
FloatingPointTests.cs Added comprehensive test suite covering floating-point precision scenarios, collection behavior, and edge cases
GeoDDCoordinate.cs Implemented tolerance-based equality operator and consistent hash code generation
GeoDDCoordinate.md Added documentation explaining the floating-point reliability fix and implementation details

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions
Copy link

github-actions bot commented Aug 30, 2025

Test Summary

    4 files      4 suites   1s ⏱️
  252 tests   252 ✅ 0 💤 0 ❌
1 008 runs  1 008 ✅ 0 💤 0 ❌

Results for commit 26c4a2f.

♻️ This comment has been updated with latest results.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions
Copy link

Code Coverage

Package Line Rate Branch Rate Complexity Health
PowerUtils.Geolocation 100% 100% 131
Summary 100% (181 / 181) 100% (70 / 70) 131

@github-actions
Copy link

@sonarqubecloud
Copy link

@NelsonBN NelsonBN merged commit 716322a into main Aug 31, 2025
9 checks passed
@NelsonBN NelsonBN deleted the fix/reliability-code branch August 31, 2025 16:27
@NelsonBN
Copy link
Member Author

🎉 This PR is included in version 2.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

1 participant