I have two questions regarding ceil() function..
-
The
ceil()function is implemented in C. If I useceil(3/2), it works fine. But when I useceil(count/2), if value of count is 3, then it gives compile time error./tmp/ccA4Yj7p.o(.text+0x364): In function
FrontBackSplit': : undefined reference toceil’ collect2: ld returned 1 exit statusHow to use the ceil function in second case? Please suggest.
-
How can I implement my own ceil function in C. Please give some basic guidelines.
Thanks.
The
ceil()function is implemented in the math library,libm.so. By default, the linker does not link against this library when invoked via the gcc frontend. To link against that library, pass-lmon the command line to gcc: