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

Renaming Catalan's constant so Catalan numbers can be defined more na… #12706

Closed
wants to merge 1 commit into from

Conversation

matthewware
Copy link

…turally.

This is just an idea to float so the catalan function in Combinatorics.jl won't be in conflict with the constant Base.catalan. I just renamed catalan -> catalan_const. Any comments are welcome!

@irrational e 2.71828182845904523536 exp(big(1))
@irrational γ 0.57721566490153286061 euler
@irrational catalan_const 0.91596559417721901505 catalan
@irrational φ 1.61803398874989484820 (1+sqrt(big(5)))/2
Copy link
Contributor

Choose a reason for hiding this comment

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

Your editor seems to have automatically converted spaces to tabs, which messes up vertical alignment in editors set up with different tab sizes (and here on github)

Copy link
Author

Choose a reason for hiding this comment

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

Ah yeah I guess I have vim set up to do that. I can take care of this. I should have read through Style.jl before submitting.

@stevengj
Copy link
Member

I don't really understand why this constant is in base at all.

@matthewware
Copy link
Author

My guess is that since it's defined in the mpfr libraries it was added into base just incase.

@KristofferC
Copy link
Member

Maybe this is not the place to discuss this but these one letter constants keep biting me in the ass. Do they really have to be exported by default? Unicode in code is becoming more and more common so is it really worth to pollute the namespace for some numbers?

@stevengj
Copy link
Member

@KristofferC, yes, we've discussed removing everything except for π.

@matthewware
Copy link
Author

I don't have strong feelings either way. @StefanKarpinski was okay with renaming. Maybe someone with more knowledge could weigh in on how important and useful it is to have this defined in Base. Maybe @jiahao has an opinion?

@jiahao
Copy link
Member

jiahao commented Aug 20, 2015

Let's keep this PR focused on catalan -> catalan_const.

e (The natural base) is discussed in #10612.

@stevengj
Copy link
Member

If we are going to rename, I would prefer catalan_constant, since const has a special meaning in Julia.

@nalimilan
Copy link
Member

I fail to see how we could rename catalan to catalan_constant without also renaming all other constants. Better move them to a Base.Constants module if they are really annoying.

@StefanKarpinski
Copy link
Member

I suspect we could just delete the Catalan constant.

@matthewware
Copy link
Author

So for now I'll just take the constant out (?) and leave the discussion of the other constants for later.

@irrational π 3.14159265358979323846 pi
@irrational e 2.71828182845904523536 exp(big(1))
@irrational γ 0.57721566490153286061 euler
@irrational φ 1.61803398874989484820 (1+sqrt(big(5)))/2
Copy link
Contributor

Choose a reason for hiding this comment

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

Since all constants' symbols are now single-letter, vertical alignment isn't needed anymore, one space would suffice (this is also valid for the two spaces between the decimal expansion and the expressions: IMO they can now be collapsed to a single space.

@ararslan
Copy link
Member

This PR is no longer relevant, as catalan is no longer exported from Base and instead now lives in MathConstants. See #23427.

@ararslan ararslan closed this Mar 18, 2019
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

Successfully merging this pull request may close these issues.

8 participants