Skip to content

Commit

Permalink
[Core] : Amend '779d1917295cf5b59cf5011f05b839b878e49a77'
Browse files Browse the repository at this point in the history
  • Loading branch information
msieben committed Jul 28, 2023
1 parent 779d191 commit 49a03b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/core/JSON.h
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ namespace Core {
default : ASSERT(false);
}

const uTYPE max = negative ? static_cast<uTYPE>(-std::numeric_limits<TYPE>::min()) : std::numeric_limits<TYPE>::max();
const uTYPE max = negative ? static_cast<uTYPE>(-(1 + std::numeric_limits<TYPE>::min())) + 1 : static_cast<uTYPE>(std::numeric_limits<TYPE>::max());

number = static_cast<uTYPE>(value);

Expand Down Expand Up @@ -922,7 +922,7 @@ namespace Core {

uTYPE divider = 1;

uTYPE value = (_set & NEGATIVE ? static_cast<uTYPE>(1 - serialize) - 1 : static_cast<uTYPE>(serialize));
uTYPE value = (_set & NEGATIVE ? static_cast<uTYPE>(-(1 + serialize)) + 1 : static_cast<uTYPE>(serialize));

while ((value / divider) >= static_cast<uTYPE>(BASETYPE)) {
divider *= BASETYPE;
Expand Down

0 comments on commit 49a03b7

Please sign in to comment.