Closed ts826848 closed 3 years ago
Fun fact: MSVC appears to produce an absolutely astounding amount of assembly for this particular compile-time pow(), the vast majority of which are seemingly pointless instantiations of pow_acc
. In this case, pow<1024>
caused MSVC to generate instantiations for pow_acc<536870911, double>
, pow_acc<9007199254740991,double>
, and pow_acc<-1025,double>
, among many, many others.
Luckily, the actual function f(double)
generated the expected assembly. The rest was certainly a surprise, though.
This has a little bit of cleaning up my previous pow() PR and also adds a pow() that uses a compile-time exponent.