FixedPointDecimals.jl icon indicating copy to clipboard operation
FixedPointDecimals.jl copied to clipboard

Julia fixed-point decimals built from integers

Results 30 FixedPointDecimals.jl issues
Sort by recently updated
recently updated
newest added

I've recently come to know both projects (https://github.com/JuliaMath/FixedPointNumbers.jl) and I think they're pretty similar, although this project focuses on fixed-point numbers for finances, whereas the other focuses on image processing....

TagBot complained here: https://github.com/JuliaMath/FixedPointDecimals.jl/issues/65 Looks like this tag still does not exist, so there is likely a problem with TagBot configuration. In the meantime, this tag should be created manually.

Last year, we made several performance improvements to FixedPointDecimals, and a lot of them used `@pure` to enforce constant folding. However, since then (as discussed in last year's JuliaCon talk...

bug
performance

We already support converting a FixedDecimal to a Rational, via: https://github.com/JuliaMath/FixedPointDecimals.jl/blob/e8c9f3b4b68c85fa0bb8813b35c27ee267114175/src/FixedPointDecimals.jl#L324-L326 We should also provide `numerator()` and `denominator()`, as part of that interface. They might be implemented like this: ```julia...

help wanted

Example: ``` julia> parse(Int64, " 5 ") 5 julia> parse(FixedDecimal{Int64,2}, " 5.0 ") ERROR: ArgumentError: invalid digit: ' ' julia> parse(FixedDecimal{Int64,2}, "5.0") FixedDecimal{Int64,2}(5.00) julia> parse(Float64, " 3.14 ") 3.14 julia>...

However, the simple overload does not seem to work, since it is ambiguous with `rem(x,y,::RoundingMode{Up})`, for example, so for `rem`, we're manually overloading all RoundingModes.

enhancement

```julia julia> one = FixedDecimal{Int,2}(1) FixedDecimal{Int64,2}(1.00) julia> one/3 FixedDecimal{Int64,2}(0.33) julia> one/3.0 0.3333333333333333 ``` Intuitively, I would expect `one/3 === one/3.0` since ```julia julia> 1/3 === 1/3.0 true ``` Strictly speaking,...

Add a custom implementation of `fldmod(x::T,y)` for when `y` is a const, and call it whenever T >= Int128. This improves performance for `*(a::FD{Int64}, b::FD{Int64})`, b/c `*` passes the result...

Opening this PR to discuss merging benchmarks into this repo, so that we can track performance across commits/versions. I'm not sure if there's a usual structure to follow for putting...

Splitting out the benchmark discussion from https://github.com/JuliaMath/FixedPointDecimals.jl/pull/36. ------ Here's the benchmark in a gist: https://gist.github.com/NHDaly/a8fae0d1d65ab1066c585c27e54146fa And the results in a google spreadsheet: https://docs.google.com/spreadsheets/d/1Lc3ughgwwK25cpwbnuLRxw19EtaMxdCsMmtnspT_4H8/edit?usp=sharing ------- Here are the results:   |   |...