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: Theodore C. Belding
Subject: Re: How to make a floating point value part of an activity
Date: Thu, 10 Apr 1997 01:17:12 -0400 (EDT)

The only things that you can really pass as arguments are pointers (id).  
Swarm makes some assumptions about being able to cast ints to 
pointers, but the same assumption doesn't seem to work for floats, as you 
found out.  As you say, you can use pointers to floats instead.

(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...)
-Ted

--
Ted Belding                      <mailto:address@hidden> 
University of Michigan Program for the Study of Complex Systems
<http://www-personal.engin.umich.edu/~streak/>

On Wed, 9 Apr 1997, Terrence M. Brannon wrote:

> The two commented out lines barf if uncommented because it appears
> that it is impossible to send messages (create actions) to objects
> with floating point arguments --- only objects are allowed. Should I
> perhaps make my functions expect pointers to floats instead of floats
> or something?
> 
> - buildActions {
>   sked = [Schedule createBegin: [self getZone]];
>   [sked setRepeatInterval: 1];
>   sked = [sked createEnd];
>   [sked at: 0 createActionTo: c message: M(process)];
>   // turn off current injection
>   // [sked at: 22 createActionTo: c message: M(currentInjection) : 0.0];
>   [sked at: 0 createActionTo: c message: M(process2)];
>   [sked at: 0 createActionTo: c message: M(display)];
> 
>   return self;
> }
> 
> -- 
> o============o  Sending  unsolicited commercial e-mail (UCE) to this address
>  Legal Notice   is indication of your consent to pay me $120/hour for 1 hour
> o============o  minimum for professional proofreading & technical assessment.
> terrence brannon * address@hidden * http://rana.usc.edu:8376/~brannon
> 
>                   ==================================
>    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.
>                   ==================================
> 

                  ==================================
   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]