Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password

Mac > Mac Programmer Help > Re: float vs. d...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 9 of 10 Topic 3779 of 3849
Post > Topic >>

Re: float vs. double

by Korchkidu <korchkidu@[EMAIL PROTECTED] > Jun 29, 2008 at 08:14 AM

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.
 



 10 Posts in Topic:
float vs. double
MacRules <dodeca001@[E  2008-06-22 09:37:54 
Re: float vs. double
MacRules <dodeca001@[E  2008-06-22 19:55:39 
Re: float vs. double
Gregory Weston <uce@[E  2008-06-22 23:42:28 
Re: float vs. double
Reinder Verlinde <rein  2008-06-23 18:56:28 
Re: float vs. double
MacRules <dodeca001@[E  2008-06-23 05:31:21 
Re: float vs. double
MacRules <dodeca001@[E  2008-06-23 18:32:47 
Re: float vs. double
Korchkidu <korchkidu@[  2008-06-24 07:55:57 
Re: float vs. double
MacRules <dodeca001@[E  2008-06-24 09:39:46 
Re: float vs. double
Korchkidu <korchkidu@[  2008-06-29 08:14:36 
Re: float vs. double
glenn andreas <gandrea  2008-06-29 10:35:42 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Oct 7 19:07:45 CDT 2008.