Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
vitstn committed Oct 28, 2024
1 parent 634dc20 commit 1853a74
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions ydb/library/yql/public/decimal/ut/yql_decimal_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ Y_UNIT_TEST_SUITE(TYqlDecimalTest) {
UNIT_ASSERT(FromStringEx("-1e-99", 10, 2) == 0);
UNIT_ASSERT(FromStringEx("-510e-3", 1, 0) == -1);
UNIT_ASSERT(FromStringEx("+99E3", 5, 0) == 99000);
UNIT_ASSERT(FromStringEx("2.1E-130", 35, 2) == 0);
}

Y_UNIT_TEST(TestFormStringExInvalidValues) {
Expand Down
4 changes: 4 additions & 0 deletions ydb/library/yql/public/decimal/yql_decimal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ namespace NDecimal {
static const TUint128 Ten(10U);

TUint128 GetDivider(ui8 scale) {
if (scale > MaxPrecision) {
return Inf();
}

TUint128 d(1U);
while (scale--)
d *= Ten;
Expand Down

0 comments on commit 1853a74

Please sign in to comment.