Exemplo n.º 1
0
        public int CompareClosedValueTo(IntervalPoint <T> other)
        {
            if (this.IsNegativeInfinity())
            {
                if (other.IsNegativeInfinity())
                {
                    return(0);
                }
                else
                {
                    return(-1);
                }
            }
            else if (this.IsPositiveInfinity())
            {
                if (other.IsPositiveInfinity())
                {
                    return(0);
                }
                else
                {
                    return(1);
                }
            }
            else if (other.IsNegativeInfinity())
            {
                if (this.IsNegativeInfinity())
                {
                    return(0);
                }
                else
                {
                    return(1);
                }
            }
            else if (other.IsPositiveInfinity())
            {
                if (this.IsPositiveInfinity())
                {
                    return(0);
                }
                else
                {
                    return(-1);
                }
            }

            return(this.Point.CompareTo(other.Point));
        }
Exemplo n.º 2
0
 private bool InfinityGreaterThanComparisons(IntervalPoint <T> other)
 {
     if (!this.IsInfinity() && !other.IsInfinity())
     {
         throw new ArgumentOutOfRangeException("At least one value must be infinity");
     }
     return(!(this.IsNegativeInfinity() || other.IsPositiveInfinity()));
 }