-
Notifications
You must be signed in to change notification settings - Fork 1
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
implement ifelse() as union of results #14
Comments
unfortunately julia> import Base: ifelse
julia> ifelse(::Int) = nothing
ERROR: cannot add methods to a builtin function
Stacktrace:
[1] top-level scope at none:0 FYI @oschulz |
I know. :-( Ran into this when I did the benchmark example in #11, that's why I had to use a custom |
Ok, I started a discussion on the Julia discourse, maybe there is some way around it |
Thanks! |
@gwater , should we reopen this now that |
I was thinking about that the other day… I'm currently working on an overhaul of the internals, basically separating the notion of numbers and intervals. Essentially I define a type struct FuzzyReal{T} <: AbstractFloat
interval::IEEE1788_Interval{T}
end and then the method would look like this ifelse(::Missing, a::FuzzyReal{T}, b::FuzzyReal{T}) = FuzzyReal(hull(a.interval, b.interval)) correct? Notably, if the two underlying intervals are disjoint, we cannot describe their union using a single IEEE1788 interval. That's why we need to take the hull of their union. |
I agree, that definition would be best - anything other than the hull (tracking the separate intervals) would have the potential of growing exponentially. I wonder if there's a better name than FuzzyReal - sounds a bit like fuzzy logic, which it's not, for course. And it may sound a bit to, well, fuzzy, for something that follows rigorous rules and gives guarantees (true result will be in the interval). Why not |
|
That's an interesting point. I have been wondering if it might be worth defining this new type (regardless of its name) with a field for the third logical value. So: struct FuzzyReal{T, V}
interval::IEEE1788_Interval{T}
indeterminate::V
end then we could set the field |
In thinking about the relationship between the number subtype and the IEEE intervals more deeply I have found that I would rather separate the notions of intervals and numbers completely. So the |
Nowadays, a Julia |
as suggested in #11
The text was updated successfully, but these errors were encountered: