Skip to content

Commit db2fb2b

Browse files
committed
Merge branch 'dcmt/sqrt512-golf-golf' into dcmt/sqrt512-golf
2 parents d0b013d + c0227b4 commit db2fb2b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/utils/512Math.sol

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1473,11 +1473,12 @@ library Lib512MathArithmetic {
14731473
// Q3.253. However, as a gas optimization, the number of fractional bits in `Y` rises
14741474
// through the steps, giving an inhomogeneous fixed-point representation. Y ≈∈ [√½, √2]
14751475
uint256 Y; // scale: 2⁽²⁵³⁺ᵉ⁾
1476+
uint256 Mbucket;
14761477
assembly ("memory-safe") {
14771478
// Extract the upper 6 bits of `M` to be used as a table index. `M >> 250 < 16` is
14781479
// invalid (that would imply M<½), so our lookup table only needs to handle only 16
14791480
// through 63.
1480-
let Mbucket := shr(0xfa, M)
1481+
Mbucket := shr(0xfa, M)
14811482
// We can't fit 48 seeds into a single word, so we split the table in 2 and use `c`
14821483
// to select which table we index.
14831484
let c := lt(0x27, Mbucket)

0 commit comments

Comments
 (0)