Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Support for non-standard integer types?

オープン
#247 コメント 4 件 リアクション 2 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
38/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
julia
領域
data

調査の方向性

FixedPointNumbers と BitIntegers を使用して Julia REPL の例を再現し、Fixed{Int24, 2}、Base.sizeof、reinterpret に焦点を当てます。成功する Fixed{Int24, 0} と Fixed{Int24, 1} のケースを、失敗する配列の reinterpret と比較します。示されているサイズの不一致なしに、標準外の整数サイズが一貫してサポートされれば完了です。

索引モデルが issue の本文から書いたものです。

説明

add-on enhancement

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

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

JuliaMath/FixedPointNumbers.jl のほかの issue

JuliaMath/FixedPointNumbers.jl の issue をすべて見る

似ている issue

Julia の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。