Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bernoulli should produce Bool #1068

Closed
MikeInnes opened this issue Feb 14, 2020 · 7 comments
Closed

Bernoulli should produce Bool #1068

MikeInnes opened this issue Feb 14, 2020 · 7 comments

Comments

@MikeInnes
Copy link
Contributor

I'm not clear why this changed in #1048 (apparently because Int may be easier to represent on quantum processors than Bool, which is not in fact the case.) I agree that it's good to be consistent, but it seems pretty clear that Bool is the right type to use here.

It's good to use the narrowest type available to represent an output, because (a) it gives useful information to tools and (b) narrow types can always be upcasted (to Int, Float etc.) but can't automatically be downcasted back to Bool, which means more code is convenient to write.

To come at it from the other direction – why use Int64 here but not Float64? Or BigInt? Or arbitrary-precision floating point?

@mschauer
Copy link
Member

I think it is simple: it should be Bool so it works in conditionals.

MikeInnes added a commit to MikeInnes/Distributions.jl that referenced this issue Feb 25, 2020
@matbesancon
Copy link
Member

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Registration pull request created: JuliaRegistries/General/11078

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.22.6 -m "<description of version>" bc34c23d2e551ed7a934fd780c088c77bad05d30
git push origin v0.22.6

@matbesancon
Copy link
Member

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Registration pull request updated: JuliaRegistries/General/11078

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.22.6 -m "<description of version>" 5f21e01923caf1655835bff7567baf2c5407a0b5
git push origin v0.22.6

@matbesancon
Copy link
Member

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Registration pull request created: JuliaRegistries/General/11143

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.23.0 -m "<description of version>" 281dae3718c8b0c771ae4e8fd0d654e659267ec0
git push origin v0.23.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants