22 July 2026
Feast of Saint Mary Magdalene (1st Century AD)
3020. 3. FORTRAN Code to calculate Transcendental Constants from π down to the constant number -366; QUAD PRECISION
program transcendental_DOWN
! Program transcendentalconstants III
implicit none
! integer, parameter :: QR_KL = selected_real_kind (32)
! real (kind=QR_K) :: pi_VAL
! integer, parameter :: QR_K = selected_real_kind (32)
! real (kind=QR_K) :: e_VAL
! integer, parameter :: QR_K = selected_real_kind (32)
! real (kind=QR_K) :: rHS
! integer, parameter :: QR_K = selected_real_kind (32)
! real (kind=QR_K) :: rHSi
REAL*16 rHS,rHSi,pi_VAL,e_VAL,HS,HT,HTF,HTS
REAL*16 InverseTransCnstnext
REAL*16 TransCnstnext
REAL*16 y, counter
integer*8 i
pi_VAL=3.141592653589793238462643383279502884197169399375105Q+00
e_VAL=2.7182818284590452353602874713526624977572470936999595Q+00
! pi_VAL = pi
! e_VAL = e
rHS= (pi_VAL / e_VAL)
rHSi=(e_VAL / pi_VAL)
! parameter (HS=0.314159265358979323D+002/0.27182818284590452D+001)
! parameter (HT=(pi*e*HS)/1.00000000000000000000D+002)
! parameter (HTF=(pi*pi)/1.0000000000000000000D+001)
! parameter (HTS=(e*HS)*(e*HS)/1.00000000000000000000D+003)
open(11,file='C:/FORTRAN/Consts DOWN INTEL studio.txt')
WRITE(11,*)'VALUE OF PI ='
WRITE(11,200) pi_VAL
WRITE(11,*)' '
WRITE(11,*)'VALUE OF E ='
WRITE(11,200) e_VAL
WRITE(11,*)' '
WRITE(11,*)'VALUE OF PI / E ='
WRITE(11,200) rHS
WRITE(11,*)' '
WRITE(11,*)'VALUE OF e / pi ='
WRITE(11,200) rHSi
WRITE(11,*)' '
print *, ' Transcendental Constants Down'
write(11,*) ' Transcendental Constants Do&
&wn'
print *, ' '
write(11,*) ' '
print *, ' Index Value of CONSTANT'
write(11,*) ' Index Value of CONSTANT'
print *, ' '
write(11,*) ' '
counter = 0.0Q000
i = 8
counter = 1.0Q0
if ( counter .eq. 1.0Q0 ) then
TransCnstnext = (pi_VAL)
InverseTransCnstnext = (1.000Q+000/( (pi_VAL)))
print *,'C equals Constant',i, ' = ', TransCnstnext
write(11,100)i, TransCnstnext
endif
counter = 0.0Q000
do 10 i = 7, -366, -1
counter = counter + 1.0Q0
y = (counter)
TransCnstnext = (pi_VAL) * ((rHSi)**(y))
InverseTransCnstnext = (1.000D+000/TransCnstnext)
print *,'C equals Constant',i, ' = ', TransCnstnext
write(11,100)i, TransCnstnext
if ( i .eq. 1) then
print *, ' '
write(11,*) ' '
endif
if ( i .eq. -15) then
print *, ' '
write(11,*) ' '
endif
if ( i .eq. -31) then
print *, ' '
write(11,*) ' '
endif
if ( i .eq. -47) then
print *, ' '
write(11,*) ' '
endif
if ( i .eq. -63) then
print *, ' '
write(11,*) ' '
endif
if ( i .eq. -79) then
print *, ' '
write(11,*) ' '
endif
if ( i .eq. -95) then
print *, ' '
write(11,*) ' '
endif
if ( i .eq. -111) then
print *, ' '
write(11,*) ' '
endif
if ( i .eq. -127) then
print *, ' '
write(11,*) ' '
endif
if ( i .eq. -143) then
print *, ' '
write(11,*) ' '
endif
if ( i .eq. -159) then
print *, ' '
write(11,*) ' '
endif
if ( i .eq. -175) then
print *, ' '
write(11,*) ' '
endif
if ( i .eq. -191) then
print *, ' '
write(11,*) ' '
endif
if ( i .eq. -207) then
print *, ' '
write(11,*) ' '
endif
if ( i .eq. -223) then
print *, ' '
write(11,*) ' '
endif
if ( i .eq. -239) then
print *, ' '
write(11,*) ' '
endif
if ( i .eq. -255) then
print *, ' '
write(11,*) ' '
endif
if ( i .eq. -271) then
print *, ' '
write(11,*) ' '
endif
if ( i .eq. -287) then
print *, ' '
write(11,*) ' '
endif
if ( i .eq. -303) then
print *, ' '
write(11,*) ' '
endif
if ( i .eq. -319) then
print *, ' '
write(11,*) ' '
endif
if ( i .eq. -335) then
print *, ' '
write(11,*) ' '
endif
if ( i .eq. -351) then
print *, ' '
write(11,*) ' '
endif
10 continue
close(11)
pause
stop
100 format(I5,E60.50)
200 FORMAT (E60.50)
! end program transcendentalconstants III
end program transcendental_DOWN

Comments powered by CComment