Hi Christian,
On 03 Nov 97, 21:52, you wrote to All
CF> void main()
int main( void ) // not the problem though
CF> float pi;
...
CF> if (pi != 3.142)
CF> cout << "\nI said 3.142!\n\n";
Floating point comparisons are seldom exact. I don't remember the exact
number of significant digits in a float, but try:
if( pi < 3.1419 && 3.1421 < pi )
cout << "I said something like 3.142! You did: " << pi
Greetings from
_____
/_|__| Auke Reitsma, Delft, The Netherlands.
/ | \ --------------------------------------
--- GEcho 1.00
---------------
* Origin: Home by the C (Auke.Reitsma@net.hcc.nl) (2:281/400.20)
|