I am new to C programming and have started in class last week. In one of our assignments, as a bonus questions, i have to determine if a double is in fact a float, i have tried everything i can think of but can't seem to find an answer since playing around with floats usually ends with imprecisions, thats what happened when i tried to force a float type on my double and compare it to itself:
if ((float)var1==var1]{
printf("is a float");
}
else {
printf("is not a float");
}
. the problem with this is that the conversion doesnt seem to work, even if i am working with a really short decimal...
Any help would be greatly appreciated !

New Topic/Question
Reply



MultiQuote






|