Continued fraction/Arithmetic/Construct from rational number: Difference between revisions
Continued fraction/Arithmetic/Construct from rational number (view source)
Revision as of 12:46, 10 February 2013
, 11 years ago→{{header|C++}}
(added python) |
|||
Line 47:
Nigel Galloway, February 9th., 2013.
*/
class r2cf : public ContinuedFraction {
private: int n1, n2;
public:
r2cf(const int numerator, const int denominator): n1(numerator), n2(denominator){}
const int nextTerm() {
const int thisTerm = n1/n2;
|