static IntInterval DivideZeroPart1(IntInterval lhs, IntInterval rhs, ref bool b) { if (lhs.IsZero()) { b = false; return(lhs); } int lhsMin = lhs.Min; int lhsMax = lhs.Max; int rhsMin = rhs.Min; int rhsMax = rhs.Max; if (lhsMax < 0) { b = true; return(new IntInterval(Integer.neg_inf, lhsMax / rhsMax)); } else if (lhsMin < 0) { b = false; return(Whole); } else { b = true; return(new IntInterval(Integer.neg_inf, lhsMin / rhsMin)); } }
static IntInterval DivideZero(IntInterval lhs) { if (lhs.IsZero()) { return(lhs); } else { return(IntInterval.Whole); } }
static IntInterval DivideNegative(IntInterval lhs, int rhsMin) { if (lhs.IsZero()) { return(lhs); } int lhsMin = lhs.Min; int lhsMax = lhs.Max; if (lhsMax < 0) { return(new IntInterval(lhsMax / rhsMin, Integer.pos_inf)); } else if (lhsMin < 0) { return(new IntInterval(Integer.neg_inf, Integer.pos_inf)); } else { return(new IntInterval(Integer.neg_inf, lhsMin / rhsMin)); } }