Skip to content

Commit

Permalink
add ishalfodd in the documentation because HalfIntegers.jl#59 takes…
Browse files Browse the repository at this point in the history
… time
  • Loading branch information
hyrodium committed Feb 3, 2024
1 parent 14f67be commit 1873339
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions docs/src/examples/type_parameter.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ using HalfIntegers
q1 = Quaternion{HalfInt}(1, 2, 3, 4)
q2 = Quaternion{HalfInt}(5.5, 6.5, 7.5, 8.5)
q3 = Quaternion{HalfInt}(1, 2, 3, 4.5) # not Hurwitz quaternion
ishalfodd(x::Number) = isodd(twice(x)) # Should be defined in HalfIntegers.jl (HalfIntegers.jl#59)
ishurwitz(q::Quaternion) = (isinteger(q.s) & isinteger(q.v1) & isinteger(q.v2) & isinteger(q.v3)) | (ishalfodd(q.s) & ishalfodd(q.v1) & ishalfodd(q.v2) & ishalfodd(q.v3))
ishurwitz(q1)
ishurwitz(q2)
Expand Down

0 comments on commit 1873339

Please sign in to comment.