On 24 juin, 18:39, MacRules <dodeca...@[EMAIL PROTECTED]
> wrote:
> > Indeed, all calculations are done using doubles internally. When you
> > use floats, they are first cast into doubles, then the computation is
> > done, and the result is cast bask into float.
>
> It depends upon what you mean by 'internally'. If you mean internal to
> the CPU, then your observation matches what I've seen so far. If you
> mean internal to the compiler, then that doesn't match because the
> ASM code I looked at had separate float and double arithmetic
> instructions, so the compiler didn't have to do any extra work to
> convert float to/from double.
>
> - Steve
Hi,
what i meant by "internally" was that the register in your CPU are
"built" for doubles. The assembler code makes the difference between
floats and doubles so that it "knows" that if it is a float, it has to
cast it first before performing the operations. This is of course far
more complex but I think is a quite good summary of what happens
inside. Anyway, as far as I know, use floats only if you have memory
problems and this sould be very rare those days...;)
K.


|