operator - [MTL Home] Programmers Guide
  Contents | Index |  Search 


Category:intervals,operator Component type:function
Prototype
template <class Tnum>
interval<Tnum> operator - (const Tnum& x, const interval<Tnum>& y) ;
Description
Subtracts an interval from a number. Subtracts each of the interval bounds of y from the number x rounding outward and returning an 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

[MTL Home] Copyright © 1998,1999 University of Notre Dame. All Rights Reserved.