between and among: worth Phobosization?

Ola Fosheim Grøstad" <ola.fosheim.grostad+dlang at gmail.com> Ola Fosheim Grøstad" <ola.fosheim.grostad+dlang at gmail.com>
Tue Dec 17 17:58:56 PST 2013


On Tuesday, 17 December 2013 at 21:57:54 UTC, Andrei Alexandrescu 
wrote:
> In an interval arithmetic approach numbers would compare 
> actually equal, i.e. 10 == IntervalInt(5, 100) would be true.


Why is that? I would think that 10 == Interval(10,10), but 
interval(5,100).contains(10) ? True interval arithmetic is 
difficult to implement though, since !(a<b) does not imply (a>=b) 
if I got it right… So you you might have to introduce a 
tri-boolean type to represent uncertainty, or prevent those 
operations, or accept inconsistencies…  Also f(a) should be the 
min/max values of f over the interval a… Tricky to compute, you 
can try numerically…


More information about the Digitalmars-d mailing list