Update calc.py

implemented Gauss-Legendre algorithm