kimhoong79
Technical User
Recently I found out some problem with sqrt(). Here's the code:
#include <stdio.h>
#include <math.h>
main()
{
int Result, Data = 4;
printf("%d\n", sqrt(Data));
Result = sqrt(Data);
printf("%d\n", Result);
}
The output of this code is
0
2
which for me, is not consistent. Can anyone explain this to me? Thanks in advance
#include <stdio.h>
#include <math.h>
main()
{
int Result, Data = 4;
printf("%d\n", sqrt(Data));
Result = sqrt(Data);
printf("%d\n", Result);
}
The output of this code is
0
2
which for me, is not consistent. Can anyone explain this to me? Thanks in advance