Skip to content

Commit 522eec3

Browse files
committed
Fix multiply.cpp.
- Fixed sign issue.
1 parent 9421e01 commit 522eec3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/multiply/multiply.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ namespace steppable::__internals::arithmetic
104104
if (steps == 2)
105105
out << "Since " << b << " is a power of 10, we can move the decimal places to obtain the result.\n";
106106
auto result = moveDecimalPlaces(a, determineScale(b));
107+
if (resultIsNegative)
108+
result = "-" + result; // NOLINT(performance-inefficient-string-concatenation)
107109

108110
out << result;
109111
return out.str();

0 commit comments

Comments
 (0)