Open mlliarm opened 2 years ago
The idea of adding a number to an interval always sounded odd to me. Maybe mark the add_n/3
predicate as deprecated in the next version of the library?
@pmoura
I haven't forgotten of your comment, I'm still thinking about it.
I remember seeing some examples where one could have added a number N (i.e. a degenerate interval i(N,N)
) to an interval i(M,L)
.
I'll have to look for that practical example(s) where such a thing could occur in applications.
You're probably right here, and this predicate could be flagged as deprecated in the next release as unnecessary; I'll have to do some more reading till then though, before agreeing with its removal.
Thanks for the suggestion!
https://github.com/mlliarm/ia/blob/aa5908a78b9c91129c4a5ac99e6ed89e3b7db3f0/interval_arithmetic.lgt#L86
I think that maybe it'd be better to use
add/3
adding the intervalsi(N,N)
andi(Xa,Xb)
instead of rewriting the logic insideadd_n/3
.How it could go like:
What do you think @pmoura ?