glaredb icon indicating copy to clipboard operation
glaredb copied to clipboard

Implement `DecimalType256` to support 256 bit precision decimals

Open vrongmeal opened this issue 2 years ago • 1 comments

Summary

We want to use a 256 bit integer to store the decimal. Need to use https://docs.rs/ethnum/latest/ethnum/struct.I256.html

Specifications

Implement the required num_traits for i256 and the rest should be as easy as creating:

impl DecimalType for DecimalType256 {
    type MantissaType = i256;
    const MAX_SCALE: u8 = 76;
}

/// Compatible with arrow's `Decimal256`.
pub type Decimal256 = Decimal<DecimalType256>;

Rationale

This way we'll be able to support 256 bit numerics (not highly urgent but good to have).

Impact

Tasks

vrongmeal avatar May 04 '23 18:05 vrongmeal

Do we have this?

scsmithr avatar Sep 08 '23 17:09 scsmithr