| |||||||
| |||||||
![]() | |||||||
Prototype | |||||||
template <class Tnum> interval<Tnum> operator - (const interval<Tnum>& x, const Tnum& y) ; | |||||||
![]() | |||||||
Description | |||||||
Subtracts a normal number from an interval. Subtracts the number
b from each of the bounds of x rounding outward.
Returns an outward rounded interval.
| |||||||
![]() | |||||||
Definition | |||||||
interval.cct | |||||||
![]() | |||||||
Preconditions | |||||||
| |||||||
![]() | |||||||
Complexity | |||||||
![]() | |||||||
Example | |||||||
In operator.cc:
C=A+B; cout << "A+B = \n" << C << endl; C-=B; cout << "A+B-B = \n" << C << endl; C/=A; cout << "(A+B-B)/A = \n" << C << endl; C*=B; cout << "((A+B-B)/A)*B = \n" << C << endl; C*=Num(5); cout << "(((A+B-B)/A)*B)*5.0 = \n" << C << endl; C+=Num(2); cout << "((((A+B-B)/A)*B)*5.0)+2.0 = \n" << C << endl; C-=A; cout << "(((((A+B-B)/A)*B)*5.0)+2.0)-A = \n" << C << endl; | |||||||
![]() | |||||||
Notes | |||||||
![]() | |||||||
See also | |||||||
Copyright ©
1998,1999 University of Notre Dame. All Rights Reserved.