Re: union
- From: "Vladimir S. Oka" <novine@xxxxxxxxxxxxxxx>
- Date: 31 Jan 2006 02:01:55 -0800
Michael Mair wrote:
> ramu wrote:
> > Vladimir S. Oka wrote:
> >
> <snip>
>
> >>>PS
> >>>Don't get into habit of using floats. Use double instead.
> >
> > Will you please tell that why we have to use double instead of floats?
>
> float has fewer significant digits and you get inexact results
> _much_ earlier. Usually, you cannot even store all long values
> exactly in a float variable.
> double has only slightly better guarantees with respect to
> the number of digits but in practice has many more.
> Using double thus means that you most of the time can forget
> about precision (numerics and excessive financial calculation
> excluded).
> <OT> Apart from that, double is definitely not slower on modern
> host PCs </OT>
Also, in many context in a C program, floats will be promoted/converted
to doubles anyway (and maybe then back to float again, if you assign
expression result to a float variable), thus negating any performance
gains you may think you got.
Cheers
Vladimir
> Cheers
> Michael
> --
> E-Mail: Mine is an /at/ gmx /dot/ de address.
.
- Follow-Ups:
- Re: union
- From: Michael Mair
- Re: union
- References:
- Prev by Date: Re: What u mean by this statemnet ?.
- Next by Date: Re: hii
- Previous by thread: Re: union
- Next by thread: Re: union
- Index(es):
Relevant Pages
|