Files
Odin/base
Simon Branch 8f4f92db8f Fix runtime quaternion division
The runtime implementations of quaternion division are incorrect when
calculating q/r with nonzero jmag(r) and either nonzero imag(q) or
kmag(q).  Notably, the inverse 1/r is still calculated correctly
because imag(1) = kmag(1) = 0.

The mistake can be verified by calculating (a/b)*b which will be very
different from both a and a * (1/b) * b.

The compile-time constant folding is correct, see exact_value.cpp
in function exact_binary_operator_value -> ExactValue_Quaternion ->
Token_Quo.

    quo256 :: proc(q, r: quaternion256) -> quaternion256 { return q/r }
    a: quaternion256 : 3 + 5i + 7j + 11k
    b: quaternion256 : 2 + 7i + 3j + 5k
    c: quaternion256 : a/b
    fmt.println("comp", abs((c*b) - a))
    fmt.println("run ", abs(quo256(a,b)*b - a))
    // both values should be very close to zero;
    // without fix, only the first is
2026-08-05 20:43:50 -07:00
..
2026-08-05 20:43:50 -07:00