GitHub - FirebirdSQL/decimal-java: Java library to encode and decode IEEE-754 decimals
Hacker News
February 24, 2026
AI-Generated Deep Dive Summary
GitHub has introduced the **decimal-java** library, a new Java-based tool designed to convert `java.math.BigDecimal` values to and from IEEE-754 decimal byte representations. This innovative library supports three key formats: decimal32 (4 bytes), decimal64 (8 bytes), and decimal128 (16 bytes). It is particularly useful for developers working with precise decimal arithmetic, especially in contexts where exact numerical representation is critical. The library’s API is stable and compatible with Java versions 7 and above, making it accessible to a wide range of projects.
The **decimal-java** library provides robust conversion capabilities between `BigDecimal` and IEEE-754r formats. It includes methods for encoding `BigDecimal` values into byte arrays and decoding byte arrays back into `BigDecimal`. For instance, the example demonstrates how a 4-byte decimal32 value can be parsed into a `BigDecimal`, while another example shows how a `BigDecimal` can be encoded into a decimal32 byte array. The library also handles edge cases like overflow scenarios, where values exceed the target
Verticals
techstartups
Originally published on Hacker News on 2/24/2026