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

Fix FloatingPoint functions: Replace instance calls with static Double #5226

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ImranQasim
Copy link

Resolved log10 and pow errors by explicitly calling Double.log10() and Double.pow(). Fixed type mismatch in division operation (shifted / magnitude). Ensured compatibility with latest Swift compiler requirements. Preparing to apply these fixes to the main library as well.

Goals ⚽

Fix Swift 5.9+ compatibility issues related to log10 and pow usage.
Ensure the library builds successfully on Xcode 16 and remains backward compatible.

Implementation Details 🚧

Replaced instance method calls on Double (log10, pow) with Foundation equivalents:
Before: log10(self < 0 ? -self : self)
After: Foundation.log10(abs(self))
Before: pow(10.0, Double(pw))
After: Foundation.pow(10.0, Double(pw))
Ensured compatibility with Swift 5.9+ by explicitly calling Foundation methods.
Updated code to ensure correct return types (e.g., Double instead of Duration).

Testing Details 🔍

Verified successful local builds on Xcode 16.
Tested with SwiftLint to ensure no new lint violations.
Validated changes using unit tests where applicable.

…e methods

Resolved log10 and pow errors by explicitly calling Double.log10() and Double.pow().
Fixed type mismatch in division operation (shifted / magnitude).
Ensured compatibility with latest Swift compiler requirements.
Preparing to apply these fixes to the main library as well.
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