julia icon indicating copy to clipboard operation
julia copied to clipboard

Rational diagonal sparse matrix division reports `integer division error`

Open eschnett opened this issue 3 years ago • 0 comments

This fails with a ERROR: DivideError: integer division error:

B = Diagonal(sparsevec([1],[1//1]))
W = Diagonal([1//1])
B / W

The expression is somewhat complicated, combining rational numbers, sparse vectors, and diagonal matrices, but it is well-defined. There should be no error.

The expression B * inv(W), which is mathematically identical, does not fail.

julia> versioninfo()
Julia Version 1.8.0-rc3
Commit 33f19bcbd25 (2022-07-13 19:10 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin21.4.0)
  CPU: 16 × Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, skylake)
  Threads: 8 on 16 virtual cores

eschnett avatar Aug 06 '22 16:08 eschnett