JuliaMath / FixedPointNumbers.jl

fixed point types for julia
Other
79 stars 34 forks source link

Problem with `unsafe_trunc` returning arbitrary values #288

Closed kimikage closed 1 month ago

kimikage commented 2 months ago

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. https://github.com/JuliaLang/julia/issues/54264)

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

kimikage commented 2 months ago

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.

kimikage commented 2 months ago

Fortuitously, this issue number is the same as the issue number in ColorTypes.jl.😇 https://github.com/JuliaGraphics/ColorTypes.jl/issues/288

kimikage commented 2 months ago

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