News for hackers. Stuff that matters.
Re:Abusing C macros to render the Mandelbrot Set at compile-... by nickodell on Tuesday November 13, 2018 @11:45PM (#18447564)
Everything above and including #define C1 returns a single value, and therefore could be done with constexpr.

More to the point, constexpr would be a heck of a lot more efficient - changing M4 to M5 increases the preprocesed size from 80 MB to 240 MB. This is an exponential increase, despite that a Mandlebrot pixel can be computed in linear time. (Linear to the maximum number of steps.)

I suspect that this is because if you write a macro and use your macro argument twice, this doubles the length of whatever your macro argument was.

There are no comments on this comment yet.