-
Notifications
You must be signed in to change notification settings - Fork 8
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
Use distinct types for RealInfinity #37
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #37 +/- ##
=======================================
Coverage 99.14% 99.15%
=======================================
Files 2 2
Lines 350 353 +3
=======================================
+ Hits 347 350 +3
Misses 3 3
☔ View full report in Codecov by Sentry. |
@@ -107,15 +107,17 @@ function mod(x::Real, ::Infinity) | |||
x | |||
end | |||
|
|||
abstract type RealInfinity <: Real end | |||
struct PositiveInfinity <: RealInfinity end | |||
struct NegativeInfinity <: RealInfinity end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good, this also makes those two types into singleton types, which may allow for better code in a few places (avoiding allocations)
Wouldn't this be a breaking change? Why not just introduce new types, and keep |
This change will make it easier to handle ambiguities and conflicts. Old interface is reserved, except for
x.signbit
fully replaced bysignbit(x)
.