JuliaMath / FixedPointNumbers.jl

fixed point types for julia

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem with `unsafe_trunc` returning arbitrary values

kimikage opened this issue · comments

I have dealt with the rem (more specifically unsafe_trunc) problem on ARM, mainly with PR #136, #223.
However, this code seems to cause bad problems under certain conditions. (cf. JuliaLang/julia#54264)

That is only likely to happen on ARM, but it can also happen on x86_64 (e.g., -1 % N0f8).

It is better to switch to a safer implementation, even if it means sacrificing some speed. Also, it would be better to backport the fix to v0.8.

Fortuitously, this issue number is the same as the issue number in ColorTypes.jl.😇
JuliaGraphics/ColorTypes.jl#288

This was fixed by #291, but we need to backport it to v0.8 and release it.