mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:07:44 +00:00
AK: Fix DeprecatedString::bijective_base_from for large numbers
The output of the DeprecatedString::bijective_base_from() is now correct for numbers larger than base^2. This makes column names display correctly in Spreadsheet.
This commit is contained in:
parent
fa34832297
commit
6b2f3ad6c8
2 changed files with 14 additions and 9 deletions
|
@ -290,7 +290,10 @@ TEST_CASE(bijective_base)
|
|||
EXPECT_EQ(DeprecatedString::bijective_base_from(25), "Z");
|
||||
EXPECT_EQ(DeprecatedString::bijective_base_from(26), "AA");
|
||||
EXPECT_EQ(DeprecatedString::bijective_base_from(52), "BA");
|
||||
EXPECT_EQ(DeprecatedString::bijective_base_from(704), "ABC");
|
||||
EXPECT_EQ(DeprecatedString::bijective_base_from(701), "ZZ");
|
||||
EXPECT_EQ(DeprecatedString::bijective_base_from(702), "AAA");
|
||||
EXPECT_EQ(DeprecatedString::bijective_base_from(730), "ABC");
|
||||
EXPECT_EQ(DeprecatedString::bijective_base_from(18277), "ZZZ");
|
||||
}
|
||||
|
||||
TEST_CASE(roman_numerals)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue