Mail Archives: djgpp/1996/02/10/03:17:05
Ignore the last missive -- =)
I just discovered the cause.
Given the following:
#define X 5
#define Y 6
float z;
z = X / Y * 5.6;
Turbo C++ evaluates X and Y as integers (!) which is what caused my
acos() domain errors. However, GCC 2.7.2 (DJGPP 2.0) _correctly_
evaluates the above; both X and Y seem to be treated as floats. "Fixing"
the defines like so:
#define X 5.0
or
#define X (float)5
now, which is the ANSI-defined behavior, that of Turbo C, or that of
DJGPP? (the evaluate-as-integer problem appeared using both Turbo C 2.0
and Turbo C++ 3.0)
Thanks,
/----------------------------------------------------------------------------\
| Orlando A. Andico "I have no concept of time, other than |
| oandico AT eee DOT upd DOT edu DOT ph it is flying." -- Alanis Morissette |
\----------------------------------------------------------------------------/
- Raw text -