swarm-support
[Top][All Lists]
Advanced

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

Re: 3/4 = 0 ???


From: Marcus G. Daniels
Subject: Re: 3/4 = 0 ???
Date: 21 Jul 1999 12:28:18 -0700
User-agent: Gnus/5.070084 (Pterodactyl Gnus v0.84) Emacs/20.4

>>>>> "DS" == DARREN MATTHEW SCHREIBER <address@hidden> writes:

DS> Fraction is defined as Others/Neighbors, but if it outputs
DS> others=3 and neighbors=4 then fraction comes out as 0... why?

You need to cast to float before doing the division. 

   fraction = (float) numOthers / (float) numNeighbors;

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