/*
    lscompounder is a basic stock/financial helper suite.
    Copyright (C) 2009  sterling pickens

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/


/*
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

void title() {
        printf("\tlscompounder is a product of the linuxsociety team and licensed under GPLv3\n");
        printf("\tThis is version 0.0.1 dated 07/23/2009\n");
        printf("\n");
return;
}

void usage() {
        printf("Usage: lscomp [principle1] [rate1] [principle2]\n");
	printf("principle1 is the starting amount.\n");
	printf("Output will then be number of days/occurences to reach principle2\n at the given interest rate.\n\n");
}
*/



double comp(double principle1, double rate1, double principle2)
{
	int i;
	//double principle1;
	//double rate1;
	//double principle2;
	double times1;

/*
	if(argc != 4){
		printf("Error, incorrect usage!\n\n");

		usage();
		return 0;
	}

*/
//	for(i=0;i<argc;i++)
//	{
//		if(i==1){
//			principle1 = atof(argv[i]);
//		}
//		if(i==2){
//			rate1 = atof(argv[i]);
//		}
  //              if(i==3){
//                        principle2 = atof(argv[i]);
 //               }

	
//	}


	
//	printf("principle1: %lf\n", principle1);
//	printf("rate1: %lf%%\n", rate1);
//	printf("principle2: %lf\n", principle2);
	
	//( log(2000) - log(1000) ) / log (1 + .02)     =  ~34.8

	rate1 = rate1 / 100;
	times1 = (log(principle2) - log(principle1)) / log(1+rate1);

//	printf("\nPeriods: %lf\n", times1);

	//printf("***%s***\n", argv[i]);





	return times1;
}



/*
int main(int argc, char *argv[]) {
	int blank;
	int num1;

	num1 = atoi(argv);
	printf("argv: %d\n", num1);


}
*/
