ok heres the code:
Code:
#include <stdio.h>
#include <math.h>
int main (int argc, char *argv[])
{
double d; int j;
d = (13 % 4);
printf("rint : d = %f\r\n", d);
j = rint(d);
printf("rint : d = %f, j = %d\r\n", d, j);
d = (13 % 4);
printf("round: d = %f\r\n", d);
j = round(d);
printf("round: d = %f, j = %d\r\n", d, j);
}
heres the output:
Code:
rint : d = 1.000000
rint : d = 1.000000, j = 1
round: d = 1.000000
round: d = 1.000000, j = 1
How come d doesn't equal 3.25 and then how come d doesn't equal 3 or four depending on the round function?