#include <iostream>
#include <stdexcept>
#include "rat.hh"

using namespace		std;

int main(int,char*[])
{
    rat p1 (1,8);
    // p2 is 2 in 3
    rat p2(2, 3);
    // p(both together) is product
    rat p3 = p1*p2;
    // p(either independent) is sum
    rat p4 = p1+p2;
    // what is answer?
    cout<<"combined prob is "<<p3<<endl;
    cout<<"independent prob is "<<p4<<endl;
    /* other test */
    cout<<rat(24,32)<<endl;
    cout<<rat(13)<<endl;
    cout<<rat(-24,-10)<<endl;
    cout<<rat(-24,10)<<endl;
	rat x;
	cout<<x<<endl;
	if(p4==p1+p2)cout<<"yes" <<endl;
    if (p1<p2)cout<<"yup"<<endl;
    cout<<p4-p3<<endl;
    cout<<p2*p1<< ' ' << p1/p2<<endl;
    try{rat z(1,0);cout<<z<<endl;}
    catch(std::exception& e){cout << e.what() << endl;}
return 0;
}






