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

Specialization of `N0f16` -> `Float16` conversion

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

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

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
julia
領域
backend

調査の方向性

The issue links to the N0f8 to Float16 conversion in src/normed.jl around lines 145–147. Read that implementation and compare its behavior with the N0f16 conversion; reproduce the two reported mismatches, then determine what conversion change would make the results match the BigFloat reference. Done means those cases convert to the expected Float16 values.

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

説明

I have long suggested considering the use of Float16 or BFloat16 for image processing tasks where there is a risk of overflow.
I personally believe that, as a result of the increasing use of GPUs in the Julia ecosystem, we find ourselves in the ironic situation where GPU support in the graphics field has lagged behind.

Even if there are counterarguments regarding my understanding of the situation, I don't think there's any problem with improving the conversion to Float16.

The current N0f8->Float16 conversion is performed via Float32, which isn't too bad.
https://github.com/JuliaMath/FixedPointNumbers.jl/blob/d62abf3a5f2f0e99e63e22eeb4835eff717c9086/src/normed.jl#L145-L147

julia> for i in 0x00:0xff
           f = Float16(i/big"255")
           n = Float16(reinterpret(N0f8, i))
           f === n && continue
           @show i, f, n
       end

On the other hand, converting from N0f16 to Float16 results in an error of 1ULP (0.5ULP).

julia> for i in 0x0000:0xffff
           f = Float16(i/big"65535")
           n = Float16(reinterpret(N0f16, i))
           f === n && continue
           @show i, f, n
       end
(i, f, n) = (0xffaf, Float16(0.9985), Float16(0.999))
(i, f, n) = (0xffef, Float16(0.9995), Float16(1.0))
主要言語
Julia
スター
95
フォーク
38
平均マージ
14時間 24分
マージ済み PR(30日)
17

環境構築

はじめの一歩

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

JuliaMath/FixedPointNumbers.jl のほかの issue

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

似ている issue

Julia の issue をもっと見る

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

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