.
- 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
> 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
> 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
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
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
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
> > #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
> #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
--
> 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
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
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
11 matches
Mail list logo