Skip to content

Commit

Permalink
comments out in english for readme
Browse files Browse the repository at this point in the history
  • Loading branch information
thurendous committed Sep 17, 2024
1 parent 84e69a7 commit 247c6c5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -548,16 +548,16 @@ const PRECISION = BigInt(1e18);
const PRECISION_FIX = BigInt(1e9);

function calculateVotingPowerFromBurnedAmount(amount) {
// 将输入转换为 BigInt
// Convert input to BigInt
amount = BigInt(amount);

// 计算 306.25 + 30*x
// Calculate 306.25 + 30*x
const innerValue = BigInt(30625) * BigInt(1e16) + BigInt(30) * amount;

// 计算 2*SQRT(306.25 + 30*x)
// Calculate 2*SQRT(306.25 + 30*x)
const sqrtPart = BigInt(2) * sqrt(innerValue) * PRECISION_FIX;

// 计算 (2*SQRT(306.25+30*x)-5)/30 - 1
// Calculate (2*SQRT(306.25+30*x)-5)/30 - 1
const result = (sqrtPart - BigInt(5) * PRECISION) / BigInt(30) - PRECISION;

return result;
Expand Down Expand Up @@ -586,10 +586,10 @@ function calculateIncrementedBurningAmount(
}

function calculateBurningAmountFromVotingPower(votingPowerAmount) {
// 将输入转换为 BigInt
// Convert input to BigInt
votingPowerAmount = BigInt(votingPowerAmount);

// 计算 y = (15*x^2+35*x)/2
// Calculate y = (15*x^2+35*x)/2
const term =
(BigInt(15) * votingPowerAmount * votingPowerAmount) / PRECISION +
BigInt(35) * votingPowerAmount;
Expand Down

0 comments on commit 247c6c5

Please sign in to comment.