G
Giorgos Keramidas
round() is standard in C99, but not in C90.
I think we recently had a thread here where someone's compiler (I
think it was gcc) recognized round(), possibly implementing it with
inline code, but the system's <math.h> header didn't declare it.
I remember one about pow() being replaced by GCC at compile time with
the result for some values. Perhaps this is the one you recall too?
The starting message was the one with:
From: Mark Healey <[email protected]>
Subject: I can't seem to use pow()
Message-Id: said:(The compiler, headers, and library are all part of the implementation
as far as the standard is concerned, but if they're provided by
different vendors or other entities they can be inconsistent.) Since
no declaration for round() was visible, the compiler had to assume
that it returns int. (And no, casting the result to double is *not* a
fix for the problem; it merely masks the error.)
I have no idea whether that's the problem here, but it's worth
investigating.
The point made above is also valid though