julia> -5/3 # or approximately;
-1.6666666666666667
but yes, I believe a rounding error and not surprising, since:
julia> bitstring(-1.6666666666666667)
"1011111111111010101010101010101010101010101010101010101010101011"
julia> bitstring(-1.6666666666666665) # not as close to the correct value in decimal, but as close, or actually closer in binary?!
"1011111111111010101010101010101010101010101010101010101010101010"
but in general you do not expect only one bit off. You can expect correctly rounded for one primitive operation, but when it's matrix multiply, it's no longer one, implicitly more, and adding up, unlike for with rationals:
julia> A=[2//3 1//3; -1//3 1//3]; v=[1,-4];
julia> A*v
2-element Vector{Rational{Int64}}:
-2//3
-5//3
Yes, it’s just roundoff errors. Because floating-point arithmetic may accumulate roundoff errors on every operation, it doesn’t follow the ordinary rules of algebra exactly in general. For example, it isn’t associative: