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

a suggestion.. better to make public so everyone can use sample tests and avoiding re-invnetig the wheel. #24

Open
ingconti opened this issue Jan 6, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@ingconti
Copy link

ingconti commented Jan 6, 2024

I see:
/// extension for convenience
private extension BinaryFloatingPoint {
/// degree converted to radians
var asRad: Self {
return rad(fromDegree: self)
}
var asDegrees: Self {
return deg(fromRadian: self)
}
var inNm: Self {
return nm(fromMeters: self)
}

}

better if public.. I suggest.

public extension BinaryFloatingPoint {

@dastrobu
Copy link
Owner

dastrobu commented Jan 8, 2024

Thank you for your suggestion.
I have some doubts, though, making the extension public (and moving it from the test sources into the non-test sources).

An extension to a very general type like BinaryFloatingPoint floating point may pollute this type more than it helps. vincenty is a very special library solving exactly one thing. Conversion from meters to other units (like nautical miles) or from radians to degree or gradians is comparatively simple and people may have different approaches. For example there is the Units and Measurement API which has nauticalMiles and UnitAngle.

A nice improvement would be adding an example to the README, which shows usage of these conversion APIs. Would that make sense to you?

@dastrobu dastrobu added the enhancement New feature or request label Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants