Skip to content

Commit

Permalink
Fix conversion of reals
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswaudby committed Jul 9, 2023
1 parent 82ea33e commit d2f1a3a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ Multicomplex numbers are a generalisation of complex numbers, recursively define
## TODO

* FFT
* The comparison `exp(0im1) == 1.` throws a TypeError


## useful links (notes to self for development)
Expand Down
5 changes: 4 additions & 1 deletion src/base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ const im6 = Multicomplex{6}(SVector{64,Int8}(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
############################

# cast real into defined multicomplex type:
Multicomplex{T,N,C}(x::Real) where {T<:Real,N,C} = Multicomplex(convert(T,x))
# Multicomplex{T,N,C}(x::Real) where {T<:Real,N,C} = Multicomplex(convert(T,x))
Multicomplex{T,0,1}(x::Real) where {T<:Real} = Multicomplex(convert(T,x))
Multicomplex{T,N,C}(x::Real) where {T<:Real,N,C} = Multicomplex{T,N,C}(convert(Multicomplex{T,0,1},x))

# cast complex into defined multicomplex type:
Multicomplex{T,1,2}(z::Complex) where {T<:Real} = Multicomplex(reim(convert(Complex{T}, z))...)
Multicomplex{T,N,C}(z::Complex) where {T<:Real,N,C} = Multicomplex{T,N,C}(convert(Multicomplex{T,1,2},z))
Expand Down

2 comments on commit d2f1a3a

@chriswaudby
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/87133

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.0 -m "<description of version>" d2f1a3a70aa51e55e9767789f1406ad837f60095
git push origin v0.1.0

Please sign in to comment.