Skip to content

Commit 8da7820

Browse files
Apply suggestions from code review
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent 23c6bb8 commit 8da7820

5 files changed

Lines changed: 6 additions & 8 deletions

File tree

test/src/lib/LibDecimalFloat.abs.t.sol

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ contract LibDecimalFloatAbsTest is Test {
1515
function absExternal(Float memory float) external pure returns (Float memory) {
1616
return LibDecimalFloat.abs(float);
1717
}
18-
/// Stack and mem are the same.
18+
/// Validate that operations using stack-based parameters (int256, int256)
19+
/// and memory-based parameters (Float struct) yield identical results.
1920

2021
function testAbsMem(Float memory float) external {
2122
try this.absExternal(float.signedCoefficient, float.exponent) returns (

test/src/lib/LibDecimalFloat.eq.t.sol

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ contract LibDecimalFloatEqTest is Test {
2121
function eqExternal(Float memory floatA, Float memory floatB) external pure returns (bool) {
2222
return LibDecimalFloat.eq(floatA, floatB);
2323
}
24-
/// Stack and mem are the same.
25-
24+
/// Test to verify that stack-based and memory-based implementations produce the same results.
2625
function testEqMem(Float memory a, Float memory b) external {
2726
try this.eqExternal(a.signedCoefficient, a.exponent, b.signedCoefficient, b.exponent) returns (bool eq) {
2827
bool actual = this.eqExternal(a, b);

test/src/lib/LibDecimalFloat.frac.t.sol

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ contract LibDecimalFloatFracTest is Test {
1515
function fracExternal(Float memory float) external pure returns (Float memory) {
1616
return LibDecimalFloat.frac(float);
1717
}
18-
/// Stack and mem are the same.
19-
18+
/// Test to verify that stack-based and memory-based implementations produce the same results.
2019
function testFracMem(Float memory float) external {
2120
try this.fracExternal(float.signedCoefficient, float.exponent) returns (
2221
int256 signedCoefficient, int256 exponent

test/src/lib/LibDecimalFloat.lt.t.sol

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ contract LibDecimalFloatLtTest is Test {
2121
function ltExternal(Float memory floatA, Float memory floatB) external pure returns (bool) {
2222
return LibDecimalFloat.lt(floatA, floatB);
2323
}
24-
/// Stack and mem are the same.
25-
24+
/// Test to verify that stack-based and memory-based implementations produce the same results.
2625
function testLtMem(Float memory a, Float memory b) external {
2726
try this.ltExternal(a.signedCoefficient, a.exponent, b.signedCoefficient, b.exponent) returns (bool lt) {
2827
bool actual = this.ltExternal(a, b);

test/src/lib/LibDecimalFloat.sub.t.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ contract LibDecimalFloatSubTest is Test {
2121
return LibDecimalFloat.sub(floatA, floatB);
2222
}
2323

24-
/// Stack and mem are the same.
24+
/// Test to verify that stack-based and memory-based implementations produce the same results.
2525
function testSubMem(Float memory a, Float memory b) external {
2626
try this.subExternal(a.signedCoefficient, a.exponent, b.signedCoefficient, b.exponent) returns (
2727
int256 signedCoefficient, int256 exponent

0 commit comments

Comments
 (0)