Files
Linux-C-Notes/Chapter2/Section2/float.c
2024-03-10 16:11:35 +08:00

10 lines
158 B
C

int func(float f)
{
if (f < 0)
return -1;
// else if (f == 0)
else if (fabs(f - 0) <= 1e-6)
return 0;
else
return 1;
}