This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<int f> | |
struct fact { | |
int n = f * fact<f-1>().n; | |
}; | |
template<> | |
struct fact<0> { | |
int n = 1; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cmath> | |
template<int size> | |
struct SinTable { | |
constexpr SinTable() : values() { | |
for (int i = 0; i < size; i++) { | |
double angle = (M_PI*2)*(((double)i)/size); |