>
> the line:
>
> float reale = 1;
>
> is the proper way to define a float type variable reale and give it an
> initial value of 1.
>
NO! Bad Karl!! Bad!
Floats and doubles are defined using the decimal place.
1.0
however, C/C++ will assume floating point literals (such as 1.0)
to be of type double, unless followed by an 'f' (1.0f).
If you leave out the f, it is no real problem. The 1.0 will be
cast to type 'float' before assignment.
Bryan Scaringe
> Yes, since a float number is large you must store it like a double
> and thus you have double precision. It is covered well in my book.
>
> On Mon, 8 Jun 1998, MCENANEY WILLIAM J wrote:
>
> > Hi Friends,
> >
> > I have two questions. First, if I write, "float reale = 1.0f", is the "f"
> > in "1.0f" redundant? Second, I have heard that the compiler converts
> > would convert reale to double precision, because it does that for every
> > variable of the type float. Thanks.
> >
> > Best wishes,
> > Bill
> >
>
> Best wishes
>
> - Karl F. Larsen, 3310 East Street, Las Cruces,NM (505) 524-3303 -
>
>