Just now, Zakwayda said:I haven't followed all the details of the thread, so maybe I'm missing some context here.
Yes. I was referring to another discussion in another topic we are having with alvaro, about optimizing sin() and acos() in a portable way but in C.
Just now, Zakwayda said:And I wouldn't just assume OOP introduces extra overhead.
You don't have to assume. That's a well established fact. If you'd like, I can show you disassembly of C and C++ code and measurements. By default C++ wastes lot more resources (RAM and CPU) than a C code, and it requires a very experienced C++ programmer to mitigate that overhead. But let's not hijack the topic.
Just now, Zakwayda said:It could of course, but I think you'd have to evaluate that on a case-by-case basis.
Just now, Zakwayda said:Lastly, not using the standard library doesn't leave you with OOP-free C
Those are both perfectly correct. In the latter case I was specifically reflecting to alvaro's code which would compile as C code just as-is. For his last code, it's easy to implement both nearbyint() and copysign() with plain C macros, those are not complex functions which would require any library support. Just for the records, nearbyint is the same as adding 0.5 and casting to int, copysign is two logical operations only.
Cheers,
bzt