Re: [ilugd]: Trivial C problem (Updated)

2002-01-30 Thread Sandip Bhattacharya
. - Sandip - Original Message - From: "Ambar Roy" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, January 30, 2002 7:07 PM Subject: Re: [ilugd]: Trivial C problem (Updated) > > This explains your second output. However, I am at a loss at the firs

Re: [ilugd]: Trivial C problem (Updated)

2002-01-30 Thread Ambar Roy
> This explains your second output. However, I am at a loss at the first output. > While I cant explain that, the fact that the difference is near a power of > 2 suggests that it has got something similar to do with the storage of the > mantissa again. essentially u r guranteed a precesion of 6 di

Re: [ilugd]: Trivial C problem (Updated)

2002-01-30 Thread Ambar Roy
> What am i doing wrong? > for those who posted > suggestions I would not like to change the data type > to something else as the float can > definitely hold this value how are u so sure that float can hold this value did u read the compiler docs for the compiler that u r using. Please d

Re: [ilugd]: Trivial C problem (Updated)

2002-01-30 Thread Sandip Bhattacharya
Real numbers are stored in the form of a mantissa and exponent. Float in glibc uses 6 decimal digits as the precision of the mantissa. Check out "/usr/lib/gcc-lib/i386-redhat-linux/3.0.2/include/float.h" --- /* Number of decimal digits of precision in a float */ #undef

Re: [ilugd]: Trivial C problem (Updated)

2002-01-30 Thread amit soni
Message - From: Vertical rains <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, January 30, 2002 11:53 AM Subject: [ilugd]: Trivial C problem (Updated) > hello everyone > >i have the following program > > /// > &g

[ilugd]: Trivial C problem (Updated)

2002-01-29 Thread Vertical rains
hello everyone i have the following program /// #include and mutually exclusively so that they do not clash with each other It does'nt help and the o/p is still the same. So somebody please HELLP Thanks everybody. Regards

Re: [ilugd]: trivial C problem

2002-01-29 Thread Ambar Roy
> > #include > > > > #include > > I vaguely remember some book mentioning us not to use both iostream and stdio.h > in the same program, because they manipulate buffers independently, and can cause > unpredictable output. essentially order in which the output comes out of interleaved c stdio & c

Re: [ilugd]: trivial C problem

2002-01-29 Thread Sandip Bhattacharya
> #include > > #include I vaguely remember some book mentioning us not to use both iostream and stdio.h in the same program, because they manipulate buffers independently, and can cause unpredictable output. - Sandip -- Sandip Bhattacharya sandipb @ bigfoot.com http://www.sandipb.net --

Re: [ilugd]: trivial C problem

2002-01-29 Thread Ambar Roy
> void main () > { > float x = 1073741855; > > printf ("%f\n", x); > cout << x; > } > > and the out put on running is as follows > > 1073741824.00 > 1.07374e+09 > > What i want to know is that why am i not > getting > the o/p as 1073741855 .There is a difference > of 31.What am i doing

Re: [ilugd]: trivial C problem

2002-01-28 Thread amit soni
gt; To: <[EMAIL PROTECTED]> Sent: Monday, January 28, 2002 8:04 PM Subject: [ilugd]: trivial C problem > hello everyone > > i have the following program > > /// > > #include > #include > void main () > { > float x = 10

[ilugd]: trivial C problem

2002-01-28 Thread Vertical rains
hello everyone i have the following program /// #include #include void main () { float x = 1073741855; printf ("%f\n", x); cout << x; } // and the out put on running is as follows 1073741824.00 1.07374e+09