It wasn't possible in standard-compliant C++ when Georg wrote his answer, but with C++11 we can now do compile-time computation with floating-point and other numeric types.
The trick is to use constexpr functions instead of non-type template parameters.