Kosmor Forum Index
 Search Imprint      SearchSearch     Log inLog in 
 Search Legal      MemberlistMemberlist     ProfileProfile   

Population... Int?

 
Post new topic   Reply to topic    Kosmor Forum Index -> Questions and Answers
View previous topic :: View next topic  
Author Message
alphabravo
Major


Joined: 15 Feb 2004
Posts: 827
Location: UK

PostPosted: Thu Nov 02, 2006 07:36    Post subject: Population... Int? Reply with quote

is population stored as a float number, or as an integer - i suspect integer, in which case, is it always rounded down?
eg: if my planet grows for 10 days at 2.9 people per day, will i have 20 more people, or 29

i presume it's 20, but im just interested to check
_________________
Major alphabravo in the house Ashera
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Claudio
Guest





PostPosted: Sun Nov 05, 2006 04:42    Post subject: Reply with quote

interesting question.

but why should Maelstroem always round down?

my suppose:

> x.5 --> round up
< x.5 --> round down

Then it depends on the single day, not over the whole 10-turn period. Because normally the increase sinks with every new single inhabitant. So in turn 1 you've got a increase of - let's say - 2.9 --> so 3.

Then - perhaps - in turn 5 you've 2.5 --> 3.

turn 6 is 2.4 --> 2

Then you have within the 1o-turn period a sum of 25 new inhabitants Wink

Just a possible answer, let's see, what Maelstroem find in his code....
Back to top
michimike
Guest





PostPosted: Sun Nov 05, 2006 05:31    Post subject: Reply with quote

I think it's 29. On some days you will surprisingly have 3 more inhabitants, on others 2.
But that's only my assumption.
Back to top
alphabravo
Major


Joined: 15 Feb 2004
Posts: 827
Location: UK

PostPosted: Sun Nov 05, 2006 14:43    Post subject: Reply with quote

does anyone have a planet with a high growth rate, with almost full population, which has simply stopped growing slightly short of it's "maximum"?

this would confirm it either way if it is rounded down
_________________
Major alphabravo in the house Ashera
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Maelstroem
Commander


Joined: 30 Jan 2004
Posts: 430
Location: Munich, Germany

PostPosted: Tue Dec 05, 2006 18:47    Post subject: Reply with quote

Claudio wrote:
interesting question.

but why should Maelstroem always round down?

The C++-compiler does, when converting floating numbers to integers. Of course, there are methods for mathematical "correct" rounding, but I am not sure, I used them. Most programmers start counting from zero and always "round down", just by habit Wink

Bye,
Maelstroem
_________________
Commander Maelstroem in the house Nemesis
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Kosmor Forum Index -> Questions and Answers All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group