Penso dipenda dalla versione di gcc o da differenti versioni di math.h.
Nel mio "i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5367)" in math.h sono presenti:
Codice PHP:
double
round(double x);
long double
roundl(long double x);
float
roundf(float x);
long int
lround(double x);
long int
lroundl(long double x);
long int
lroundf(float x);
long long int
llround(double x);
long long int
llroundl(long double x);
long long int
llroundf(float x);
...
STANDARDS
The round() , lround() , and llround() functions conform to ISO/IEC
9899:1999(E).
Per evitare il warning nell'assegnamento del double a int prova ad applicare un'operazione di cast esplicita:
Codice PHP:
int aInt = static_cast <int> (round (2.51));