This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
gcc -fsingle-precision-constant
- From: Mathieu Malaterre <mathieu dot malaterre at kitware dot com>
- To: gcc at gcc dot gnu dot org
- Date: Fri, 27 Aug 2004 17:58:27 -0400
- Subject: gcc -fsingle-precision-constant
- Organization: Kitware Inc.
Hello,
I was trying to compile:
template <class Type>
inline Type clamp(const Type a,
const Type b,
const Type c) { return a > b ? (a < c ? a : c) : b ; }
int main()
{
double a = 5.0;
double b = clamp(a, -1., 1. );
return 0;
}
Using
gcc -fsingle-precision-constant foo.cxx
And gcc returns:
foo.cxx: In function `int main()':
foo.cxx:9: error: no matching function for call to `clamp(double&,
float, float
)'
I believe that by default all floating point number should be consider
double. Am I correct ?
Thanks
Mathieu