Skip to content

yggdrasil.data.types.primitive.numeric.decimal

decimal

:class:DecimalType — fixed-precision decimal numbers.

Decimals stay strict relative to integers / floats: their merge behavior keeps DecimalType intact and never bridges across the numeric kinds, so a DecimalType.merge_with(IntegerType(...)) goes through the usual cross-id resolver rather than collapsing the two sides into one. The byte_size auto-derives from precision (≤38 ⇒ 16-byte Decimal128, otherwise 32-byte Decimal256) — the field is computed in __post_init__ so callers don't have to think about it.