Skip to content

Commit eecb8be

Browse files
committed
Fix trig issues.
1 parent d94ea5f commit eecb8be

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/calc/trig/trig.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,12 @@ namespace steppable::__internals::arithmetic
125125
// 13x + 660x + 15120
126126
auto a = add(subtract(multiply("313", x4, 0), multiply("6900", x2, 0), 0), "15120", 0);
127127
auto b = add(add(multiply("13", x4, 0), multiply("660", x2, 0), 0), "15120", 0);
128-
return standardizeNumber(divide(a, b, 0, decimals * 2));
128+
return standardizeNumber(divide(a, b, 0, decimals + 2));
129129
}
130130
// otherwise use recursion
131131
// double C = cos(x / 4);
132-
auto result = _cos(standardizeNumber(divide(x, "4", 0, decimals + 1)), decimals * 2);
133-
auto result2 = roundOff(multiply(result, result, 0), static_cast<long>(decimals) * 2);
132+
auto result = _cos(standardizeNumber(divide(x, "4", 0, decimals + 1)), decimals + 2);
133+
auto result2 = roundOff(multiply(result, result, 0), static_cast<long>(decimals) + 2);
134134
// return 8 * C2 * (C2 - 1) + 1;
135135
return standardizeNumber(add(multiply("8", multiply(result2, subtract(result2, "1", 0), 0), 0), "1", 0));
136136
}

0 commit comments

Comments
 (0)