Skip to content

Commit

Permalink
fixed show for 0
Browse files Browse the repository at this point in the history
  • Loading branch information
jishnub committed Mar 7, 2020
1 parent bb8354b commit 5a98d42
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "MultiplesOfPi"
uuid = "b749d01f-fee9-4313-9f11-89ddf7ea9d58"
authors = ["Jishnu Bhattacharya", "Center for Space Science", "New York University Abu Dhabi"]
version = "0.2.0"
version = "0.2.1"

[compat]
julia = "1"
Expand Down
3 changes: 2 additions & 1 deletion src/MultiplesOfPi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ Base.convert(::Type{PiTimes{T}},p::PiTimes) where {T} = PiTimes{T}(p.x)

function Base.show(io::IO,p::PiTimes)
pxstr = isone(p.x) ? "" : string(p.x)
print(io,pxstr,"Pi")
str = iszero(p) ? string(p.x) : pxstr*"Pi"
print(io,str)
end

end # module
6 changes: 6 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -346,4 +346,10 @@ end
@test String(take!(io)) == "Pi"
show(io,2Pi)
@test String(take!(io)) == "2Pi"
show(io,0*Pi)
@test String(take!(io)) == "0"
show(io,im*Pi)
@test String(take!(io)) == "0 + Pi*im"
show(io,Pi + im*(2//3)Pi)
@test String(take!(io)) == "Pi + 2//3Pi*im"
end

4 comments on commit 5a98d42

@jishnub
Copy link
Owner Author

@jishnub jishnub commented on 5a98d42 Mar 7, 2020

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/10661

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 Julia TagBot is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.1 -m "<description of version>" 5a98d4207a3321654383b96ccb86b0b1d79b99c1
git push origin v0.2.1

Also, note the warning: Version 0.2.1 skips over 0.2.0
This can be safely ignored. However, if you want to fix this you can do so. Call register() again after making the fix. This will update the Pull request.

@jishnub
Copy link
Owner 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 updated: JuliaRegistries/General/10661

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 Julia TagBot is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.1 -m "<description of version>" 5a98d4207a3321654383b96ccb86b0b1d79b99c1
git push origin v0.2.1

Please sign in to comment.