Julia: unicode alias for Gamma function

Created on 2 Nov 2016  ·  7Comments  ·  Source: JuliaLang/julia

I feel that Γ = gamma should be defined in Base. Furthermore, shouldn't it be Gamma instead of gamma?

Obviously this is completely unimportant but would be kind of nice. The fact that γ is the Euler-Mascheroni constant without loading any special modules brings me indescribable joy, having the Gamma function would do similar.

decision speculative

Most helpful comment

FWIW, the fact that (in many context) random letters are defined brings me much sadness when I don't get an error when I forget to define a variable.

All 7 comments

This would break the Distributions package. Please do not do this.

I think the name of the function is gamma and not Gamma. I'd be fine with defining const Γ=gamma. @johnmyleswhite that part shouldn't break anything in Distributions, right?

Nope, it's the capital Gamma that would break using Distributions.

FWIW, the fact that (in many context) random letters are defined brings me much sadness when I don't get an error when I forget to define a variable.

Just for the record, and for the sake of making this issue thread seem somewhat less maliciously arbitrary, I thought of this when brainstorming symbols that I would _never_ use because they have some special definition, which is probably something worth thinking about, though obviously the list will differ depending on a persons field of expertise. For most of my life Γ has been pretty important, so I don't use it, except for the Γ function. It's slightly confusing that the gamma function is gamma instead of Gamma because it is represented by Γ, but it certainly wasn't my intention to suggest breaking any major code.

Despite the aforementioned indescribable joy, I would be perfectly fine with e and π being the only single-character constants or functions which are defined without using (in fact I use γ frequently despite the fact that the Euler-Mascheroni constant occurs in dimensional regularization, so I can't really argue for keeping it).

Edit: No, as @stevengj pointed out, I definitely also used Γ for decay rates a lot, so I guess that totally invalidates this statement.

Γ is used for lots of other things, e.g. in physics it is often used for linewidths and decay rates. I don't think the usage for the gamma function is universal enough to justify defining this globally.

In contrast, π is pretty much exclusively used for 3.14159..., although interestingly enough, in Gauss's original manuscript (in Latin!) on trigonometric interpolation of periodic functions (in which he derived what is now known as an FFT algorithm), he used π for the number of samples (π = 12!).

By the same token, our current global definition of γ for eulergamma seems questionable to me.

Oh man, line width, yeah clearly I had not thought this through at all...

Ok, I no longer think this is a good idea either. Was being overzealous. Sorry.

I still think there is something to using Gamma over gamma, but if that's going to break things I'm sure it is not going to happen, so I'll close this issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

omus picture omus  ·  3Comments

i-apellaniz picture i-apellaniz  ·  3Comments

arshpreetsingh picture arshpreetsingh  ·  3Comments

StefanKarpinski picture StefanKarpinski  ·  3Comments

sbromberger picture sbromberger  ·  3Comments