View Single Post
  #4  
Old July 7th, 2004, 05:13 PM
Taqwus's Avatar

Taqwus Taqwus is offline
Major General
 
Join Date: Aug 2000
Location: Mountain View, CA
Posts: 2,162
Thanks: 2
Thanked 4 Times in 4 Posts
Taqwus is on a distinguished road
Default Re: Sudden zero population

It's a wild shot in the dark, but this might occur if they're using integer arithmetic to update populations and an overflow happens.
e.g. instead of

x += x * (pop_growth/1000.0) with floating-point arithmetic, using
x += (x * pop_growth) / 1000 with integer arithmetic.
If x*pop_growth or similar expression exceeds approximately 4.2 billion (unsigned 32-bit integer) or 2.1 billion (signed 32-bit integer) weirdness could happen... although landing at exactly zero is strange unless there's a follow-up check that sets x to 0 if it were otherwise negative.
__________________
Are we insane yet? Are we insane yet? Aiiieeeeee...
Reply With Quote