Title: Stash interest rate incorrect? Post by: ahydra on March 03, 2009, 11:21:36 PM This is my stash screen atm:
344.676.773 Interest Rate: 0.02% but the text underneath says 0.01% for every 100M, so it should be 0.03%. In fact up to today it's been working fine (rounding appropriately) but for some reason it now seems to have frozen at 0.02%. ahydra edit: it's now 399.991.787 and showing 0.04% (correct). Not sure what's happening :confused: edit2: I donated, got a bunch of credits and it's gone wrong again. 12.302.110.395 Interest Rate: 1.22% (should be 1.23%) Looks suspiciously like floating point rounding problems - suggest using a 64-bit integer type for the stash credits (and regular credits etc) and then dividing this down to 100x the interest rate first, then converting to a float, rounding and dividing by 100. Title: Re: Stash interest rate incorrect? Post by: KenquinnTheInsaneOne on March 19, 2009, 10:55:26 PM First things first the game is written in Java not C++ nearly every browser based game is written in java or javascrpit and not c++ due to how easily java can be hooked in to websites.
I know Emi uses BigINTs and BigDecimals most variables in SpaceO there is no upper limit on the value for either type. Well there is a limit dependent on his ram its just to large to be considered a worry. Also the interest rates can take a bit to update. Your example of 12.302.110.395 credits only giving 1.22% interest would be a case of this. Also just because that value is displaced does not mean you do not get 1.23% in reality its just a value displayed. What happen under the abstraction of the UI cant be said for sure. There are many other little issue in the game like it Displaying SP/AP as a ship stat when they are not in use. Various spelling issues and typos are also rampant in SpaceO. |