-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Generic isfinite
method
#36380
Generic isfinite
method
#36380
Conversation
9dc1210
to
05c2da2
Compare
05c2da2
to
04d4f26
Compare
Rebased and resolved conflict |
From triage. Seems better to narrow the scope to |
@@ -54,6 +54,7 @@ Base.zero(::Union{Type{P},P}) where {P<:Period} = P(0) | |||
Base.one(::Union{Type{P},P}) where {P<:Period} = 1 # see #16116 | |||
Base.typemin(::Type{P}) where {P<:Period} = P(typemin(Int64)) | |||
Base.typemax(::Type{P}) where {P<:Period} = P(typemax(Int64)) | |||
Base.isfinite(::Union{Type{P}, P}) where {P<:Period} = true |
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.
Following the lead of how isfinite
is implemented for TimeType
as that also supports taking the type
The usefulness of |
Implements a generic
isfinite
method which should work for any type supporting subtraction andiszero
. My motivation behind the change is that I was writing some generic code which neededisfinite
to work withChar
andPeriod
instances.