Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2000:
[Freeciv-Dev] Re: amortize
Home

[Freeciv-Dev] Re: amortize

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Freeciv dev list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: amortize
From: Robert Rendell <rob@xxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 13 Jun 2000 11:36:09 +1000 (EST)

Thue Janus Kristensen wrote:
} in amortize, what does this mean?:
} 
}     if (denom > 1) {
}       benefit = (benefit + (denom/2)) / denom;
}     }
} 
} more specifically, why doesn't it just say "benefit = benefit/denum" ?

It looks like it's rounding off the result to the nearest int - basically
the same as (int) ((float)benefit/denom + 0.5), but avoiding the floating
point.
                                                        Have fun,
                                                         Rob R.
                                                          \((/
                                                          ~oo~
                                                          /))\



[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Re: amortize, Robert Rendell <=