Recent content by mrous27
-
M
Comp Sci How can I calculate pi in Fortran without using intrinsic functions?
Thanks for this also :) I will try to fix them.- mrous27
- Post #8
- Forum: Engineering and Comp Sci Homework Help
-
M
Comp Sci How can I calculate pi in Fortran without using intrinsic functions?
Thakns,It is forbidden to use sin(x) and cos(x). We have to use these infinite series to describe sin(x) and cos(x) to Fortran.- mrous27
- Post #6
- Forum: Engineering and Comp Sci Homework Help
-
M
Comp Sci How can I calculate pi in Fortran without using intrinsic functions?
My attempt ; PROGRAM ASD IMPLICIT NONE REAL::SINX,x,cosx,z INTEGER::I,N=9000 DO i = 1,n x=0.5 n=1 sinx=0. sinx=sinx+z n=n+1 z=z+(-1)**n*x**(2*n+1)/((2*n-2)*(2*n-1)) print*, sinx END DO DO i = 1,n x=0.5 n=1 cosx=0...- mrous27
- Post #4
- Forum: Engineering and Comp Sci Homework Help
-
M
Comp Sci How can I calculate pi in Fortran without using intrinsic functions?
Homework Statement I have a project about pi. We are wanted to calculate pi in Fortran 90/95,without use intrinsic functions. For example, we must think like a computer. Homework Equations We must use formula of sin(x) and cos(x) for find 'pi'. When Sin(x)=cos(x) (and error is 10**-4)...- mrous27
- Thread
- Fortran Pi
- Replies: 9
- Forum: Engineering and Comp Sci Homework Help