<commit_before>//
//  Pi.cpp
//  Calculator
//
//  Created by <NAME> on 3/27/14.
//  Copyright (c) 2014 <NAME>. All rights reserved.
//

#include "Pi.h"
Pi::Pi(){
    this->type = "pi";
    this->coefficient = new Integer(1);
}
Pi::~Pi(){
    delete this;
}
Integer* Pi:: getCoefficient()
{
	return coefficient;
}
void Pi:: setCoefficient(Integer* x)
{
	this->coefficient = x;
}

Expression* Pi::add(Expression* a){
   Pi* c = this;

	if(a->type == "pi"){
        Pi *b = (Pi *)a;
		Integer* aCoef = b->getCoefficient();
		Integer* thisCoef = c->getCoefficient();
		Integer* sum = (Integer *)thisCoef->add(aCoef);
		c->setCoefficient(sum);
	}
    return c;

}
Expression* Pi::subtract(Expression* a){

  Pi* c = this;

	if(a->type == "pi"){
        Pi *b = (Pi *)a;
		Integer* aCoef = b->getCoefficient();
		Integer* thisCoef = c->getCoefficient();
		Integer* sum = (Integer *)thisCoef->subtract(aCoef);
		c->setCoefficient(sum);
	}
    return c;


}
Expression* Pi::multiply(Expression* a){
    Pi* c = this;

	 if(a->type == "pi"){
        Pi *b = (Pi *)a;//Casts a
		Integer* aCoef = b->getCoefficient();//Gets coefficient of the thing that's being multiplied
		Integer* thisCoef = c->getCoefficient();//Gets coefficient of this
		Integer* product = (Integer *)thisCoef->multiply(aCoef);//Multiplies two coefficients together
		Pi* pi1 = new Pi();//creates new Pi
		Exponential* exponential = new Exponential((Expression *)pi1,(Rational *)2);//Creates new Exponential with base pi and exponent 2
		Expression* d = exponential->multiply(product);//multiplies the new pi^2 by the multiplied product
		return d;
		}
	else if(a->type == "exponential"){
        Exponential *b = (Exponential *)a;//Casts a
        if(b->getBase()->type == "pi"){ // Checks to see if the base is pi
            Rational* exponent = b->getExponent();//gets exponent of b
            Pi* pi2 = new Pi();//creates new Pi
            Rational* one = new Rational(1,1);
            Exponential* product = new Exponential((Expression*)pi2,(Rational *)(exponent->add(one)));
            Integer* Coef = c->getCoefficient();//Gets the coefficient of the type pi
            Expression* d = Coef->multiply(product);//multiplies the coefficient of e with the new Exponential type
            return d;
            }
        }

	}


Expression* Pi::divide(Expression* a){
	  Pi* c = this;

	 if(a->type == "pi"){
        Pi *b = (Pi *)a;//Casts a
		Integer* aCoef = b->getCoefficient();//Gets coefficient of the thing that's dividing (x/a)...a
		Integer* thisCoef = c->getCoefficient();//Gets coefficient of this(x/a)..x
		Integer* product = (Integer *)thisCoef->divide(aCoef);//Divides this by a
		return product;//pi divided by pi is 1, so we just return the product
		}
	else if(a->type == "exponential"){
        Exponential *b = (Exponential *)a;//Casts a
        if(b->getBase()->type == "pi"){ // Checks to see if the base is pi
            Rational* exponent = b->getExponent();//gets exponent of b
            Pi* pi2 = new Pi();//creates new Pi
            Rational* one = new Rational(1,1);
            Exponential* product = new Exponential((Expression*)pi2,(Rational *)(one->subtract(exponent)));// creates new Exponential with base e and exponent 1 - previous exponent
            Integer* Coef = c->getCoefficient();//Gets the coefficient of the type pi
            Expression* d = Coef->multiply(product);//multiplies the coefficient of pi with the new Exponential type
            return d;
            }
        }

	}<commit_msg>Some methods needed a return statement. Added comments where I added them<commit_after>//
//  Pi.cpp
//  Calculator
//
//  Created by <NAME> on 3/27/14.
//  Copyright (c) 2014 <NAME>. All rights reserved.
//

#include "Pi.h"
Pi::Pi(){
    this->type = "pi";
    this->coefficient = new Integer(1);
}
Pi::~Pi(){
    delete this;
}
Integer* Pi:: getCoefficient()
{
	return coefficient;
}
void Pi:: setCoefficient(Integer* x)
{
	this->coefficient = x;
}

Expression* Pi::add(Expression* a){
   Pi* c = this;

	if(a->type == "pi"){
        Pi *b = (Pi *)a;
		Integer* aCoef = b->getCoefficient();
		Integer* thisCoef = c->getCoefficient();
		Integer* sum = (Integer *)thisCoef->add(aCoef);
		c->setCoefficient(sum);
	}
    return c;

}
Expression* Pi::subtract(Expression* a){

  Pi* c = this;

	if(a->type == "pi"){
        Pi *b = (Pi *)a;
		Integer* aCoef = b->getCoefficient();
		Integer* thisCoef = c->getCoefficient();
		Integer* sum = (Integer *)thisCoef->subtract(aCoef);
		c->setCoefficient(sum);
	}
    return c;


}
Expression* Pi::multiply(Expression* a){
    Pi* c = this;

	 if(a->type == "pi"){
        Pi *b = (Pi *)a;//Casts a
		Integer* aCoef = b->getCoefficient();//Gets coefficient of the thing that's being multiplied
		Integer* thisCoef = c->getCoefficient();//Gets coefficient of this
		Integer* product = (Integer *)thisCoef->multiply(aCoef);//Multiplies two coefficients together
		Pi* pi1 = new Pi();//creates new Pi
		Exponential* exponential = new Exponential((Expression *)pi1,(Rational *)2);//Creates new Exponential with base pi and exponent 2
		Expression* d = exponential->multiply(product);//multiplies the new pi^2 by the multiplied product
		return d;
		}
	else if(a->type == "exponential"){
        Exponential *b = (Exponential *)a;//Casts a
        if(b->getBase()->type == "pi"){ // Checks to see if the base is pi
            Rational* exponent = b->getExponent();//gets exponent of b
            Pi* pi2 = new Pi();//creates new Pi
            Rational* one = new Rational(1,1);
            Exponential* product = new Exponential((Expression*)pi2,(Rational *)(exponent->add(one)));
            Integer* Coef = c->getCoefficient();//Gets the coefficient of the type pi
            Expression* d = Coef->multiply(product);//multiplies the coefficient of e with the new Exponential type
            return d;
            }
        }
        //need to return something if its not these two cases. Added return c.
        return c;
	}


Expression* Pi::divide(Expression* a){
	  Pi* c = this;

	 if(a->type == "pi"){
        Pi *b = (Pi *)a;//Casts a
		Integer* aCoef = b->getCoefficient();//Gets coefficient of the thing that's dividing (x/a)...a
		Integer* thisCoef = c->getCoefficient();//Gets coefficient of this(x/a)..x
		Integer* product = (Integer *)thisCoef->divide(aCoef);//Divides this by a
		return product;//pi divided by pi is 1, so we just return the product
		}
	else if(a->type == "exponential"){
        Exponential *b = (Exponential *)a;//Casts a
        if(b->getBase()->type == "pi"){ // Checks to see if the base is pi
            Rational* exponent = b->getExponent();//gets exponent of b
            Pi* pi2 = new Pi();//creates new Pi
            Rational* one = new Rational(1,1);
            Exponential* product = new Exponential((Expression*)pi2,(Rational *)(one->subtract(exponent)));// creates new Exponential with base e and exponent 1 - previous exponent
            Integer* Coef = c->getCoefficient();//Gets the coefficient of the type pi
            Expression* d = Coef->multiply(product);//multiplies the coefficient of pi with the new Exponential type
            return d;
            }
        }
    //need to return something if neither of these cases are met. added return c.
    return c;

	}
{'fraction_non_alphanumeric': 0.15197693574958815, 'fraction_numerical': 0.006864360241625481, 'mean_word_length': 2.8606253312135665, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 79, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7494241', 'n_tokens_mistral': 2445, 'n_tokens_neox': 2324, 'n_words': 720}