>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
Yes.. well... useing float pi; and not double pi; was the error. Thanx
yway.
__ __ __ __ _ _
/_ // / // ///\// email: cfelde@online.no
_ _ __ __//_ /_//_//_/// homepage: http://home.sol.no/~cfelde/
--- BBBS/L v3.33 How
---------------
* Origin: Fluxpod Information eXchange, telnet://fix.no (2:210/30)
|