Negative number of fractional bits
还没有人认领这个 Issue。
评估
调研方向
首先检查现有的 Fixed 类型,以及将 fractional-bit 参数限制为非负值的方法。比较演示的负位行为,并确定 package 应该泛化 Fixed,还是引入单独的 scaled-integer 类型;完成此任务需要确定设计方案,并为所请求的类型提供受支持的行为。
由索引模型根据 Issue 内容生成。
描述
With Fixed we can reduce the number of fractional bits to trade range for precision:
julia> Fixed{Int8, 2} .|> (typemin, typemax, eps)
(-32.0Q5f2, 31.75Q5f2, 0.25Q5f2)
julia> Fixed{Int8, 1} .|> (typemin, typemax, eps)
(-64.0Q6f1, 63.5Q6f1, 0.5Q6f1)
julia> Fixed{Int8, 0} .|> (typemin, typemax, eps)
(-128.0Q7f0, 127.0Q7f0, 1.0Q7f0)
However, currently support stops here. It would be useful to have a
julia> Fixed{Int8, -1} .|> (typemin, typemax, eps)
(-256.0Q8f-1, 254.0Q8f-1, 2.0Q8f-1)
and all the other types with a negative number of fractional bits available, when range demands are high, precision demands are low and you want to distribute the available values uniformly in the range or want to use integer arithmetic (so floating points are not an option).
This would not really match the packet's name as they are not really fixed-point numbers (with the "point" being outside of the represented bits). On the other hand, an implementation of these numbers (scaled integers) seems to be completely identical in representing the type (struct) and should cover both positive and negative numbers of fractional bits if some methods are generalized or their domain restrictions are relaxed.
So what would these scaled integers be? Would they use a slightly generalized version of Fixed, would they be a ScaledInteger within the FixedPointNumbers.jl package or would they be the topic of a ScaledIntegers.jl package?
- 主要语言
- Julia
- 星标
- 95
- 派生
- 38
- 平均合并
- 1 天 7 分钟
- 30 天内合并 PR
- 4
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
JuliaMath/FixedPointNumbers.jl 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
JuliaMath/FixedPointNumbers.jl#310 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
-
难度 5/5 一周以上 新手友好度 42/100
JuliaMath/FixedPointNumbers.jl#331 · 7 条评论 ·
-
needs comments
难度 3/5 1-2 天 新手友好度 68/100
JuliaMath/FixedPointNumbers.jl#318 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
查看 JuliaMath/FixedPointNumbers.jl 的全部 Issue
相似的 Issue
-
`default_linear_interpolation` is called with its arguments swapped, so its opt-outs never apply未关闭
难度 2/5 1-3 小时 新手友好度 78/100
SciML/OrdinaryDiffEq.jl#4684 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
SciML/Evolutionary.jl#182 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 92/100
jmejia8/Metaheuristics.jl#130 ·
-
docs
难度 1/5 1 小时以内 新手友好度 90/100
JuliaLang/julia#63454 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复