program T_stdtype

use std_type

intrinsic :: radix,huge,bit_size,range,minexponent,maxexponent 
!	radix vraci pouzivany zaklad ciselne soustavy
!	huge vraci maximalni hodnotu pouziteho typu
!	bit_size(I) vraci pocet bitu obsazenych celym cislem I
!	range vraci DEKADICKY maximalni exponent


Integer :: defi				! default pro INTEGER
integer(kind=i1b) :: ii1
integer(kind=i2b) :: ii2
integer(kind=i4b) :: ii4
integer(kind=i8b) :: ii8

real :: defr				! default pro REAL
real(kind=sp) :: sp1
real(kind=dp) :: dp1

print *,char(10),"Zakladni informace o zobrazeni cisel"
!	Operator // spojuje retezce v jeden;
!	char(10) je znak pro LF (novy radek)
!	Za prikazem PRINT nasleduje automaticky LF; dalsi dostaneme i takto
print *,"====================================",char(10)
print *,char(10),"Pouzivany zaklad ciselne soustavy = ",radix(ii1)

print *,char(10),"Celociselne typy",char(10)
print *,char(10)//"Typ INTEGER (default)"
print *,"huge(INTEGER) = ",huge(defi)
print *,"Pocet bytu na typ INTEGER = ",bit_size(defi)/8
print *,"Maximalni dekadiky exponent = ",range(defi)
print *,char(10)//"INTEGER(KIND=i1b)"
print *,"huge(i1b) = ",huge(ii1)
print *,"Pocet bytu na (KIND=i1b) = ",bit_size(ii1)/8
print *,"Maximalni dekadiky exponent = ",range(ii1)
print *,char(10)//"INTEGER(KIND=i2b)"
print *,"huge(i2b) = ",huge(ii2)
print *,"Pocet bytu na (KIND=i2b) = ",bit_size(ii2)/8
print *,"Maximalni dekadiky exponent = ",range(ii2)
print *,char(10)//"INTEGER(KIND=i4b)"
print *,"huge(i4b) = ",huge(ii4)
print *,"Pocet bytu na (KIND=i4b) = ",bit_size(ii4)/8
print *,"Maximalni dekadiky exponent = ",range(ii4)
print *,char(10)//"INTEGER(KIND=i8b)"
print *,"huge(i8b) = ",huge(ii8)
print *,"Pocet bytu na (KIND=i8b) = ",bit_size(ii8)/8
print *,"Maximalni dekadiky exponent = ",range(ii8)
print *
print *,"==============================================="

print *,"Informace o realnych cislech: stiskni ENTER",char(10)
read *	! ceka az precte z klavesnice ENTER

print *,char(10)//"Informace o zobrazeni realnych cisel"
Print *,"Pro typ COMPLEX, resp. COMPLEX(KIND=DP) se to tyka"
print *, "realne i imaginarni casti (jsou tehoz typu) "
print *,char(10)//"Typ REAL (default)"
print *,"huge(REAL) = ",huge(defr)
print *,"Maximalni exponent (dekadicky) = ",range(defr)
print *,"Mmaxialni exponent (radix=",radix(defr),") = ",maxexponent(defr)
print *,"Minimalni exponent (radix=",radix(defr),") = ",minexponent(defr)
print *,"epsilon(REAL) = ",epsilon(defr)

print *,char(10)//"KIND=SP"
print *,"huge(SP) = ",huge(sp1)
print *,"Maximalni exponent (dekadicky) = ",range(sp1)
print *,"Mmaxialni exponent (radix=",radix(sp1),") = ",maxexponent(sp1)
print *,"Minimalni exponent (radix=",radix(sp1),") = ",minexponent(sp1)
print *,"epsilon(REAL) = ",epsilon(sp1)

print *,char(10)//"KIND=DP"
print *,"huge(DP) = ",huge(dp1)
print *,"Maximalni exponent (dekadicky) = ",range(dp1)
print *,"Mmaxialni exponent (radix=",radix(sp1),") = ",maxexponent(dp1)
print *,"Minimalni exponent (radix=",radix(dp1),") = ",minexponent(dp1)
print *,"epsilon(REAL) = ",epsilon(dp1)

print *,char(10)//" Konec: stiskni ENTER"
read *

end program T_stdtype


