-
Notifications
You must be signed in to change notification settings - Fork 71
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
Broken functions for complex intervals #41
Comments
I'm sure you already carefully thought about typing of I did so for Measurement type in |
Hmm, I haven't tried it; that's good idea, thanks! It's not actually very clear to me what that would imply though. |
See the branch |
For the complex functions, they would automatically use the See JuliaPhysics/Measurements.jl#1 for the discussion about typing of |
However I see that |
I am not that convinced that we still need
|
I see. That was my main concern for If ambiguities you mentioned above can be fixed, this can probably the solution to all these issues ;-) |
I was actually not aware of |
Sorry for joining you too late in this discussion...
In contrast to
As @dpsanders answered, it would get rid of Let me twist a bit @giordano's idea, and create a julia> const AbstractFloatAndRational = Union{subtypes(AbstractFloat)..., Rational}
Union{BigFloat, Float16, Float32, Float64, Rational}
julia> abstract type AbstractInterval <: AbstractFloat end
julia> type Interval{T<:AbstractFloatAndRational} <: AbstractInterval
lo :: T
hi :: T
end
julia> Interval{T<:AbstractFloatAndRational}(a::T, b::T) = Interval{T}(a,b)
Interval
julia> Interval(0.0, 1.0)
Interval{Float64}(0.0, 1.0)
julia> Interval(0//1, 1//1)
Interval{Rational{Int64}}(0//1, 1//1)
julia> setprecision(BigFloat, 64)
64
julia> Interval(big(0.0), big(1.0))
Interval{BigFloat}(0.00000000000000000000, 1.00000000000000000000) I'm not so sure if this can solve the problems of this issue, but it allows to have |
Thanks for chiming in this discussion! I see your point and I agree that with interval arithmetic you can do probably all arithmetic with Regarding your proposal, my only concert is that if you want to keep both As a side note, I think that const AbstractFloatAndRational = Union{AbstractFloat, Rational} that isn't limited to the value of |
The simplest thing to do is just define methods to act directly on Complex Intervals and not hold our breath to see when things are improved in Base. |
In Julia's Base library, mathematical non-arithmetic functions of real argument are eventually defined only for specific types of |
|
The following functions are currently broken for complex intervals; see JuliaLang/julia#22095.
They give a stack overflow due to incorrect fallbacks in base Julia:
exp
,sin
,cos
,cosh
,sinh
-- due tosincos
sqrt
,log
,log1p
,log2
,log10
asin
,acos
,atan
tanh
,asinh
,acosh
,atanh
sinpi
,cospi
,sinc
,cosc
The text was updated successfully, but these errors were encountered: