Simpatico
v1.10
Main Page
Modules
Namespaces
Classes
Files
File List
File Members
src
util
math
Rational.cpp
1
/*
2
* Util Package - C++ Utilities for Scientific Computation
3
*
4
* Copyright 2010 - 2017, The Regents of the University of Minnesota
5
* Distributed under the terms of the GNU General Public License.
6
*/
7
8
#include "Rational.h"
9
10
namespace
Util
11
{
12
13
/*
14
* Output stream inserter for a Rational.
15
*/
16
std::ostream&
operator <<
(std::ostream& out,
Rational
const
&a)
17
{
18
out << a.num_;
19
if
(a.den_ != 1) {
20
out <<
"/"
<< a.den_ ;
21
}
22
return
out;
23
}
24
25
}
Util::operator<<
std::ostream & operator<<(std::ostream &out, const Pair< Data > &pair)
Output a Pair to an ostream, without line breaks.
Definition:
Pair.h:57
Util
Utility classes for scientific computation.
Definition:
accumulators.mod:1
Util::Rational
A Rational number (a ratio of integers).
Definition:
Rational.h:33
Generated on Wed Mar 7 2018 12:59:42 for Simpatico by
1.8.11