I don't really get why using <math.h> would make the program more complex, add to SLOC, make it slower... I don't think it is a big loss to use -lm, as it is mostly a problem with the libc you might be using if you have to link with an extra library for math functions.

Also, specifying something as a macro does not make it faster automatically. The great thing about compilers is that they can make your code faster by optimizing it themselves!

Finally, I don't think that reimplementing a function that already is in the standard library for "more efficiency" makes any sense. Correctness is most important, and I rather trust my C library implementation on that.

Reply via email to