Can global variable be passed into Python function?

Marko Rauhamaa marko at pacujo.net
Fri Feb 28 19:32:18 EST 2014


"Mark H. Harris" <harrismh777 at gmail.com>:

>     if (n**2 < D(1)):
>         a = __atan__(n)
>     elif (n == D(1)):
>         a = gpi/4
>     elif (n == D(-1)):
>         a = -(gpi/4)
>     elif (n < D(-1)):
>         a = __atan__Lt_neg1__(n)
>     else:
>         a = __atan__Gt_1__(n)

Drop the outermost parentheses in the if statements. They add to the
clutter.

Anyway, how would you express the above in, say, Java?


Marko



More information about the Python-list mailing list