My question is this: is there a way to always use the extended precision versions of mathematical functions - such as sqrt, exp, &c - without using an explicit cast when providing a single or double precision argument?
For example I want this functionality, without the hassle of the casting:
float x=15.0;
float answer;
answer=sqrt((long double)x);
This comes in the context of scientific computing, where many iterations of a loop containing such functions is required. Even though at the end of the process I only require single precision, the floating point errors that result during each iteration can sum to something significant after a few thousand iterations. Thanks.