ClickHouse / ClickHouse/ClickHouse

Unexpected Behavior in Decimal Type Conversion (Decimal(38,38))

Open
#70,128 1 comment 0 reactions 0 assignees View on GitHub
comp-decimal external potential bug
Dominant language
C++
Stars
49.9k
Forks
9k
Avg merge
21h 32m
Merged PRs (30d)
515

Description

Inserting a `toDecimal32(4, 5)` value into a `Decimal(38, 38)` column produces an unexpected result.

Version: 24.10.1.862
```sql
create table t (a Decimal(38,38)) engine=Memory;

insert into t values (toDecimal32(4,5));

select a from t;
```

Output:
```
0.59717633079061536536625392568231788544
```

https://fiddle.clickhouse.com/87f18fcf-98d5-46ef-8260-7f6c762f0d5f

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.