FixedPointNumbers.jl
FixedPointNumbers.jl copied to clipboard
fixed point types for julia
This seems like a gotcha (indeed it caught us out when manipulating images): ```jl julia> x = N0f8(0.5) 0.502N0f8 julia> x + x 0.0N0f8 ```
It would be great if FixedPointNumbers could add support for the `read` function, i.e. `read(io, N4f12)`, that would handle the padding and other issues. For example, given a 24-bit long...
I would like to use `` to shift bits of fixed point numbers. For example, suppose `x` is a fixed point, then I want `x >> 1` to be something...
The original formulation of the README made me think that the bit pattern of `Fixed{IntN,f}` numbers is `[sign bit] [Int(N-1) number]`. I hope this alternative formulation makes it clearer that...
As noted in #199, unsigned `Fixed` and signed `Normed` are mathematically definable, but we still have some preparations to implement them. Although those types are certainly not used often, but...
As commented in https://github.com/JuliaMath/FixedPointNumbers.jl/pull/143#issuecomment-559182211, `Fixed`/`Normed` (i.e. the difference in scaling factor) and signed/unsigned are orthogonal concepts. | Type (scaling) | `Fixed` (`2^f`) | `Normed` (`2^f-1`) | |---------------:|:-------------------|:-------------------| | signed |...
Here's a draft supporting [CheckedArithmetic](https://github.com/JuliaMath/CheckedArithmetic.jl). Perhaps the key question is resolving the discussion in #143, determining which type should be used as the `accumulatortype`. For `*` and `/`, IMO the...
I'd like to move the whole JuliaImages stack to version numbers >= 1.0 (see https://github.com/JuliaImages/Images.jl/issues/825). Let's use this issue to collect plans for breaking changes in the near future. Breaking...
This pull request sets up the CompatHelper workflow on this repository. cc: @DilumAluthge
Julia [suggests using `Rational` numbers](https://docs.julialang.org/en/v1/manual/style-guide/#Avoid-using-floats-for-numeric-literals-in-generic-code-when-possible) rather than floating-point literals, as floats are more disruptive. While good advice in general, this means code following the style guide will tend to disrupt...