swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to make a floating point value part of an activity


From: Kevin Crowston
Subject: Re: How to make a floating point value part of an activity
Date: Thu, 10 Apr 1997 19:36:21 -0500

>(Now that I think about this, I don't really understand why this is so. Does
>anybody know?  Are the floats are implicitly being converted to doubles by C
>or Obj C?  ints and pointers are both 32 bits on most machines, and
>floats are always 32 bits if they're IEEE single precision...)

I wondered about this too (see my earlier postings about storing floats in
Arrays) so I reread the section on type conversion in the C manual (I
assume the same rules apply in ObjC).  I had assumed that you could cast
any 32-bit item to any other by simply reinterpreting the bits, but not so.
Only int to pointer is allowed and supported; float to pointer is
explicitly ruled out.  You're not even allowed to cast a float into a
pointer.

In the case of sending a message, sending a pointer to float seems like the
best approach, rather than hacking around trying to make a float look like
an id.

Kevin



                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.
                  ==================================


reply via email to

[Prev in Thread] Current Thread [Next in Thread]