not to rewrite this for float and double is exactly the point of templates