Initial commit
This commit is contained in:
BIN
Chapter2/Section2/bool
Executable file
BIN
Chapter2/Section2/bool
Executable file
Binary file not shown.
10
Chapter2/Section2/bool.c
Normal file
10
Chapter2/Section2/bool.c
Normal file
@@ -0,0 +1,10 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
bool a = false;
|
||||
printf("a = %d\n", a);
|
||||
exit(0);
|
||||
}
|
||||
10
Chapter2/Section2/float.c
Normal file
10
Chapter2/Section2/float.c
Normal file
@@ -0,0 +1,10 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user