elixir-explorer / explorer

Series (one-dimensional) and dataframes (two-dimensional) for fast and elegant data exploration in Elixir
https://hexdocs.pm/explorer
MIT License
1.12k stars 123 forks source link

Use `coef: i128` in decimal #1017

Closed billylanchantin closed 1 week ago

billylanchantin commented 1 week ago

Changes our ExDecimal representation to:

pub struct ExDecimal {
    pub sign: i8,
    pub coef: i128, // was u64
    pub exp: i64,
}

This gives us the ability to represent larger decimals. The trade-off is we could technically create an invalid ExDecimal in our Rust code. But I don't think it's a practical concern: we just need to be careful to always call .abs() when we instantiate it.