JuliaGeometry / Quaternions.jl

A Julia implementation of quaternions
https://juliageometry.github.io/Quaternions.jl
MIT License
116 stars 37 forks source link

Update around `inv` #133

Closed hyrodium closed 9 months ago

hyrodium commented 10 months ago

Before this PR

julia> using Quaternions

julia> Quaternion(1,2,3,4) // Quaternion(5,6,7,8)
ERROR: MethodError: no method matching //(::Quaternion{Int64}, ::Quaternion{Int64})

Closest candidates are:
  //(::Number, ::Complex)
   @ Base rational.jl:79
  //(::AbstractArray, ::Number)
   @ Base rational.jl:82

After this PR

julia> using Quaternions

julia> Quaternion(1,2,3,4) // Quaternion(5,6,7,8)
Quaternion{Rational{Int64}}(35//87, 4//87, 0//1, 8//87)

This behavior is consistent with //(::Complex, ::Complex)

julia> complex(1,2) // complex(5,6)
17//61 + 4//61*im
codecov[bot] commented 10 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (89232ef) 100.00% compared to head (bfaf0c6) 100.00%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #133 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 2 2 Lines 162 164 +2 ========================================= + Hits 162 164 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.