Skip to content

Commit eb9b811

Browse files
committed
lint
1 parent c286fe5 commit eb9b811

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/sd59x18/Trigonometry.sol

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { SD59x18 } from "./ValueType.sol";
55
import { uUNIT } from "./Constants.sol";
66

77
// Pi / 2;
8-
int256 constant uPI2 = 1_570796326794896619;
8+
int256 constant uPI2 = 1_570796326794896619;
99

1010
// Cordic renormalisation factor
1111
int256 constant K = 607252935008881256;
@@ -75,11 +75,11 @@ int256 constant ATAN31 = 465661287;
7575

7676
function cordic_step(int256 x, int256 y, int256 z, int256 f, int256 t) pure returns (int256 x2, int256 y2, int256 z2, int256 f2) {
7777
assembly {
78-
let delta := sub(mul(sgt(z, 0), 2), 1) // z > 0 ? 1 : -1
78+
let delta := sub(mul(sgt(z, 0), 2), 1) // z > 0 ? 1 : -1
7979
x2 := sub(x, sdiv(mul(mul(delta, y), f), uUNIT)) // x - delta * y * f / uUNIT
8080
y2 := add(y, sdiv(mul(mul(delta, x), f), uUNIT)) // y + delta * x * f / uUNIT
81-
z2 := sub(z, mul(delta, t)) // z + delta * t
82-
f2 := shr(1, f) // f / 2
81+
z2 := sub(z, mul(delta, t)) // z + delta * t
82+
f2 := shr(1, f) // f / 2
8383
}
8484
}
8585

@@ -124,10 +124,7 @@ function cordic(int256 t) pure returns (int256, int256) {
124124
(x, y, z, f) = cordic_step(x, y, z, f, ATAN31);
125125
x = x * K / uUNIT;
126126
y = y * K / uUNIT;
127-
return (q == 0) ? (x, y) :
128-
(q == 1) ? (-y, x) :
129-
(q == 2) ? (-x, -y) :
130-
(y, -x);
127+
return (q == 0) ? (x, y) : (q == 1) ? (-y, x) : (q == 2) ? (-x, -y) : (y, -x);
131128
}
132129
}
133130

0 commit comments

Comments
 (0)