decimal icon indicating copy to clipboard operation
decimal copied to clipboard

Decimal Floating Point arithmetic for rust

Results 28 decimal issues
Sort by recently updated
recently updated
newest added

How are folks dealing with the need to have const/static d128 literals? It seems like it might be possible these days to have the `d128!()` macro and things like `zero()`...

The `decNumberRescale` is more convenient than `quantize` in some situations where rounding is desired. It would be nice to support a `rescale` method on `d128`. I'm not sure exactly how...

The calculate crate would benefit from using `d128` instead of `f64` for calculating floats accurately. The ion shell uses calculate for it's built-in calc command. The methods above are required...

```rust error[E0308]: mismatched types --> src/dec128.rs:229:35 | 229 | decQuadToString(self, buf.as_mut().as_mut_ptr()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8 | = note: expected type `*mut u8` found type `*mut i8` error[E0308]: mismatched...

A `d128.sqrt()` (like `f64.sqrt()`) method would be useful.

This is basically a rewrite of #16 using procedural macros which were stabilized in the 2018 edition (rustc 1.31.0). There are a few things that I haven't addressed yet, since...

I need to round and fetch the integer equivalent of a d128 instance. There don't appear to be many ways to do this. The closest I've found is to use...

Hi I want to use decimal64 data type in my own C program. So how can I add this library in my C program? Thanks

It seems like the `exp()` method causes an infinite loop no matter what you give it. Example: ```rust use decimal::d128; fn main() { d128!(10).exp(d128!(0)); } ```

The idea is to use `decQuadReduce()` function that eliminates insignificant zeroes from the number before hashing.