Category : Files from Magazines
Archive   : CUJ9201.ZIP
Filename : 1001096B
Listing 5
//
// rational.cpp
//
#include "rational.h"
rational rational::operator+(rational r)
{
return rational(num * r.denom + r.num * denom,
denom * r.denom);
}
rational rational::operator-(rational r)
{
return rational(num * r.denom - r.num * denom,
denom * r.denom);
}
rational rational::operator*(rational r)
{
return rational(num * r.num, denom * r.denom);
}
rational rational::operator/(rational r)
{
return rational(num * r.denom, denom * r.num);
}
void rational::put(FILE *f)
{
fprintf(f, "(%ld/%ld)", num, denom);
}
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/