aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2023-09-24 22:52:38 +0200
committer GitHub <noreply@github.com>2023-09-24 22:52:38 +0200
commit3714db86f7c52674e044566096f389660a67a039 (patch)
tree1a0797c6c1cb5ecedbebf7eae3ee3500889329ba /src
parent079536b18f818febf25319e4efffc083e0ab224b (diff)
parentdaff5222267fb6d13351c72b2d8fbfea836494a8 (diff)
Merge pull request #32 from OpenVicProject/fixed-point-fix
Stopped fixed point falling for Zeno's paradox
Diffstat (limited to 'src')
-rw-r--r--src/openvic-simulation/types/fixed_point/FixedPoint.hpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/openvic-simulation/types/fixed_point/FixedPoint.hpp b/src/openvic-simulation/types/fixed_point/FixedPoint.hpp
index 913f237..efe92a6 100644
--- a/src/openvic-simulation/types/fixed_point/FixedPoint.hpp
+++ b/src/openvic-simulation/types/fixed_point/FixedPoint.hpp
@@ -571,7 +571,7 @@ namespace OpenVic {
int64_t ret = 0;
for (int i = PRECISION - 1; i >= 0; --i) {
decimal >>= 1;
- if (parsed_value > decimal) {
+ if (parsed_value >= decimal) {
parsed_value -= decimal;
ret |= 1 << i;
}