|
From: Matthias S. <mat...@us...> - 2007-04-02 23:26:25
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21355 Modified Files: measurement.hpp Log Message: minor update Index: measurement.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/measurement.hpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- measurement.hpp 31 Mar 2007 01:17:16 -0000 1.4 +++ measurement.hpp 2 Apr 2007 23:26:24 -0000 1.5 @@ -16,6 +16,7 @@ #include <iomanip> #include <iostream> +#include <boost/numeric/interval.hpp> #include <boost/units/static_rational.hpp> namespace boost { @@ -66,6 +67,10 @@ value_type value() const { return value_; } value_type uncertainty() const { return uncertainty_; } + value_type lower_bound() const { return value_-uncertainty_; } + value_type upper_bound() const { return value_+uncertainty_; } + + interval<value_type> get_interval() const { return interval<value_type>(lower_bound(),upper_bound()); } this_type& operator+=(const value_type& val) { @@ -99,8 +104,8 @@ this_type& operator/=(const this_type& /*source*/); private: - value_type value_, - uncertainty_; + value_type value_, + uncertainty_; }; } |