USE PORTLIB

IMPLICIT NONE

REAL A4, B4, C4, Pi4
REAL*8 A8, B8, C8, Pi8
INTEGER VER

WRITE(*,*) "Entre com o valor de A8 (real dupla) ="
READ(*,*) A8

OPEN(9,file="saida13d.txt")

	A4 = A8

	WRITE(9,*) "A4 = A8 =", A4
	B4 = ABS(A4)
	B8 = DABS(A8)
	WRITE(9,*) "B4 = Módulo com	ABS(A4) =", B4
	WRITE(9,*) "B8 = Módulo com DABS(A8) =", B8
	
	C4 = LOG10(B4)
	C8 = DLOG10(B8)
	WRITE(9,*) "C4: Logaritmo decimal com LOG10(B4) =", C4
	WRITE(9,*) "C8: Logaritmo decimal com DLOG10(B8) =", C8
	
	Pi4 = ACOS(-1.0e0)
	Pi8 = DACOS(-1.0d0)
	WRITE(9,*) "Pi com ACOS(-1.0e0) = ", Pi4
	WRITE(9,*) "Pi com DACOS(-1.0d0) = ", Pi8
	
	WRITE(9,*) A8, "= A8 sem formato"
	WRITE(9,21) A8, A8, A8, A8, A8
	WRITE(9,11) A8, B8, C8
	WRITE(9,12) A8, B8, C8
	
CLOSE(9)

VER = SYSTEM("Notepad saida13d.txt")

11 FORMAT( 	5X, "A8 =", 1PE15.3, 1/, 	&
			5X, "B8 =", 1PE15.3, 1/, 	&
			5X, "C8 =", 1PE15.3, 1/ 	)
			
12 FORMAT( 3(1PE10.1), "= variáveis A8, B8 e C8 no formato 3(1PE10.1)" )

21 FORMAT(	"A8 no formato F8.2 	 =", F8.2, 1/, 		&
			"A8 no formato F5.0 	 =", F5.0, 1/, 		&
			"A8 no formato E15.3 	 =", E15.3, 1/, 	&
			"A8 no formato 1PE15.2 	 =", 1PE15.2, 1/, 	&
			"A8 no formato 1PE15.2E3 =", 1PE15.2E3, 1/ 	)

END
