[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 3/4 = 0 ???
From: |
surak |
Subject: |
Re: 3/4 = 0 ??? |
Date: |
Wed, 21 Jul 1999 14:28:24 -0500 (CDT) |
Hi,
I believe you need to cast numOthers and numNeighbors as floats or else
the outcome of the division of ints will be an int. Try:
fraction=(float)numOthers/(float)numNeighbors
instead.
Hope that helps,
Alan
>
> if (numNeighbors != 0)
> fraction=(numOthers/numNeighbors);
> else
> fraction=100.0; // This is a warning flag for division
> by zero
>
==================================
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.
- Zone usage: alloc: vs. allocBlock:, Ken Cline, 1999/07/20
- Re: Zone usage: alloc: vs. allocBlock:, Marcus G. Daniels, 1999/07/21
- Re: Zone usage: alloc: vs. allocBlock:, Ken Cline, 1999/07/21
- Re: Zone usage: alloc: vs. allocBlock:, Marcus G. Daniels, 1999/07/21
- Re: Zone usage: alloc: vs. allocBlock:, Ken Cline, 1999/07/21
- 3/4 = 0 ???, DARREN MATTHEW SCHREIBER, 1999/07/21
- Re: 3/4 = 0 ???, Marcus G. Daniels, 1999/07/21
- Re: 3/4 = 0 ???,
surak <=
- Re: 3/4 = 0 ???, Rick Riolo, 1999/07/21