#include <stdio.h>


int clkRate()
{
	return 2000;
}



const int MILLISECONDS_PER_SECOND = 1000;
#define MS_TO_TICKS(ms) ( ( (float)(ms)/ MILLISECONDS_PER_SECOND) * clkRate() )


void convertAndPrint(int ms)
{
	int  ticksInt;
	unsigned ticksUint;
	double ticksDbl;
	float ticksFlt;
	
	ticksInt = MS_TO_TICKS(ms);
	ticksUint= MS_TO_TICKS(ms);
	ticksFlt = MS_TO_TICKS(ms);
	ticksDbl = MS_TO_TICKS(ms);
	
	printf("Milliseconds: %i\n", ms);
	printf("Expected val: %i\n",ms*2);
	printf("Signed Int  : %2i\n"
		   "Unsigned Int: %2u\n"
		   "Floating Pnt: %.13f\n"
		   "Double Precn: %.13f\n"
		   "Direct Macro: %.13f\n",ticksInt,ticksUint,ticksFlt, ticksDbl, MS_TO_TICKS(ms));

}

void weirdConversionDemo(void)
{

	
	convertAndPrint(7);
	printf("\n\n\n\n");
	convertAndPrint(10);
	
}


int main(void) {
	weirdConversionDemo();
	return 0;
}
