[ create a new paste ] login | about

Link: http://codepad.org/0efh0w19    [ raw code | output | fork ]

emanresu - C, pasted on Sep 2:
#include <stdio.h>
#include <stdlib.h>

	float
f1(int a,int b,int c)
{
	return (a+b+c)/3/255.0f;
}

        float
f2(int a,int b,int c)
{
	return (a+b+c)/3.0/255.0f;
}

	int
main()
{
	printf("%f\n",	f1(2,1,1));
	printf("%f\n",	f2(2,1,1));
        exit(EXIT_SUCCESS);
}


Output:
1
2
0.003922
0.005229


Create a new paste based on this one


Comments: