Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rounding down error fix #11

Closed
wants to merge 1 commit into from

Conversation

AlecWhite
Copy link

Hopefully fixes #10 and any other non-1-hour interval for accuracy's sake. Ideally it would need truncation of display value.

Hopefully fixes brandon-ray#10 and any other non-1-hour interval for accuracy's sake.
Ideally it would need truncation of display value.
@brandon-ray
Copy link
Owner

Hey thanks so much for the PR! I realized though that the math for the calculations is correct as it is currently and they were mistaken. We do actually need to round down. I'll paste what I wrote there to the other person:

"Instead take a cracking unit, which has a cycle time of 160s, which would be 22.5 cycles per hour, and it calculates only 22 cycles ... I think you get the issue, the rounding shouldn't be there at all."

If there are 22.5 cycles per hour, the .5 is not completed yet so if we added that to the calculation its actual output will not be for another 80 seconds. The amount produced does not increase as the time does, all of the actual "resource creations" happens at the end of the 160s. If it was incremental and made that amount over time that would make sense, but with how the game handles production the math is correct as is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Input/Output calculations being off due to rounding
2 participants