Bug in Julia rational array inplace multiplication

To expand on what @DNF said, what’s happening is

julia> Rational(1//1 * (1/5))
3602879701896397//18014398509481984

which happens to be correct (although somewhat unexpected if you are not aware of how floating point works). Cf

1 Like