RosettaCodeData/Task/Host-introspection/Fortran/host-introspection.f
Ingy döt Net db842d013d A-M baby
2013-04-10 21:29:02 -07:00

13 lines
333 B
Fortran

integer :: i
character(len=1) :: c(20)
equivalence (c, i)
WRITE(*,*) bit_size(1) ! number of bits in the default integer type
! which may (or may not!) equal the word size
i = 1
IF (ichar(c(1)) == 0) THEN
WRITE(*,*) "Big Endian"
ELSE
WRITE(*,*) "Little Endian"
END IF