Skip to content

Cleanup tgmath wrappers. #15304

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

Merged
merged 2 commits into from
Mar 17, 2018
Merged

Conversation

stephentyrone
Copy link
Contributor

  • Remove special-case gyb logic for lgamma on Darwin; the symbols we need are always present, even if not visible in the headers, so we only need a prototype.
  • Add some deprecations for symbols that have direct stdlib analogues.
  • Make some operations generic on [Binary]FloatingPoint, where they can map to the protocols instead of calling libm.

- Remove special-case gyb logic for lgamma on Darwin; the symbols we need are always present, even if not visible in the headers, so we only need a prototype.
- Add some deprecations for symbols that have direct stdlib analogues.
- Make some operations generic on [Binary]FloatingPoint, where they can map to the protocols instead of calling libm.
return (x.significand / 2, Int(x.exponent + 1))
}

@available(swift, deprecated: 4.2, message: "Use scalbn<T>(:T,:Int).")
Copy link
Contributor

Choose a reason for hiding this comment

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

Does scalbn give the same result? If so, then maybe a renamed: instead of message: would provide a better developer experience (i.e. fix-it and migration).

UPD: It does look like the implementation for scalbn is similar.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, they're identical in actual behavior for every current type. They would behave differently for decimal types, but we don't really want these to be the interfaces going forward anyway.

@moiseev
Copy link
Contributor

moiseev commented Mar 16, 2018

@swift-ci Please Test Source Compatibility

@milseman
Copy link
Member

@swift-ci please test

@stephentyrone
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 0844a87

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 0844a87

@stephentyrone
Copy link
Contributor Author

@swift-ci Please smoke test OS X.

@stephentyrone stephentyrone merged commit ddf70fa into swiftlang:master Mar 17, 2018
@stephentyrone stephentyrone deleted the tgmath-cleanup branch March 24, 2018 20:33
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.

4 participants