Support for non-standard integer types?
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
FixedPointNumbers と BitIntegers を使用して Julia REPL の例を再現し、Fixed{Int24, 2}、Base.sizeof、reinterpret に焦点を当てます。成功する Fixed{Int24, 0} と Fixed{Int24, 1} のケースを、失敗する配列の reinterpret と比較します。示されているサイズの不一致なしに、標準外の整数サイズが一貫してサポートされれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Sorry if this is naive, but would it be possible to support fixed point representations of non-standard integer sizes? It looks like it would be a simple thing to fix:
Example:
julia> using FixedPointNumbers, BitIntegers
julia> BitIntegers.@define_integers 24;
julia> sizeof(Int24)
3
julia> sizeof(Fixed{Int24, 2}) # I think this is what causes reinterpret below to fail
4
julia> reinterpret(Fixed{Int24, 2}, UInt8.(1:3))
ERROR: ArgumentError: cannot reinterpret an `UInt8` array to `Fixed{Int24, 2}` whose first dimension has size `3`.
The resulting array would have non-integral first dimension.
Stacktrace:
[1] (::Base.var"#thrownonint#243")(S::Type, T::Type, dim::Int64)
@ Base ./reinterpretarray.jl:27
[2] reinterpret(#unused#::Type{Fixed{Int24, 2}}, a::Vector{UInt8})
@ Base ./reinterpretarray.jl:42
[3] top-level scope
@ REPL[8]:1
julia> Base.sizeof(::Type{<:Fixed{Int24}}) = 3
# This stuff below is correct, right?
julia> reinterpret(Fixed{Int24, 0}, UInt8.(1:3))
1-element reinterpret(Fixed{Int24, 0}, ::Vector{UInt8}):
197121.0Q23f0
julia> reinterpret(Int24, UInt8.(1:3))
1-element reinterpret(Int24, ::Vector{UInt8}):
197121
julia> reinterpret(Fixed{Int24, 1}, UInt8.(1:3))
1-element reinterpret(Fixed{Int24, 1}, ::Vector{UInt8}):
98560.5Q22f1
julia> reinterpret(Int24, UInt8.(1:3)) / 2
1-element Vector{Float64}:
98560.5
- 主要言語
- Julia
- スター
- 95
- フォーク
- 38
- 平均マージ
- 16時間 31分
- マージ済み PR(30日)
- 9
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
JuliaMath/FixedPointNumbers.jl のほかの issue
-
bug
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
JuliaMath/FixedPointNumbers.jl#343 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 62/100
JuliaMath/FixedPointNumbers.jl#342 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
JuliaMath/FixedPointNumbers.jl#337 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 42/100
JuliaMath/FixedPointNumbers.jl#331 · コメント 7 件 ·
メンテナーはふだん 1 日以内に返信
-
needs comments
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
JuliaMath/FixedPointNumbers.jl#318 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
JuliaMath/FixedPointNumbers.jl の issue をすべて見る
似ている issue
-
`enzymexla.linalg.lu` lowering fails for a tall matrix: the permutation is built with the pivot typeオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
EnzymeAD/Enzyme-JAX#3286 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
SciML/LinearSolve.jl#1359 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
EnzymeAD/ReactantNitro.jl#13 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信