Earlier quoted context omitted.
> everyone else says "pshaw, anyone could have written that!" it really depends on the problem domain tho, doesnt it? Would you call the fast inverse square root[0] code good taste? [0] https://en.wikipedia.org/wiki/Fast_inverse_square_root#Overv...
Being a good fit for a given purpose doesn't mean that something is in good taste. That piece of code is very performant, yes, but I'm pretty sure none of us would want to meet it in code review, save for a few niche edge cases. To draw a parallel from fashion, for most part, arctic snow gear does not win fashion prizes, but it does keep you alive. There's a time and place for both, doesn't mean that everything usefu…
It does no I/O and has no action-at-a-distance. The float-long-float casts are the worst part.
If a coworker brought it to me with a performance justification and some unit tests I'd be pretty happy to pass it.