compact_real.f90 Source File

PENF's testing program.

This File Depends On

sourcefile~~compact_real.f90~~EfferentGraph sourcefile~compact_real.f90 compact_real.f90 sourcefile~penf.f90 penf.F90 sourcefile~penf.f90->sourcefile~compact_real.f90 sourcefile~penf_b_size.f90 penf_b_size.F90 sourcefile~penf_b_size.f90->sourcefile~penf.f90 sourcefile~penf_stringify.f90 penf_stringify.F90 sourcefile~penf_b_size.f90->sourcefile~penf_stringify.f90 sourcefile~penf_global_parameters_variables.f90 penf_global_parameters_variables.F90 sourcefile~penf_global_parameters_variables.f90->sourcefile~penf.f90 sourcefile~penf_global_parameters_variables.f90->sourcefile~penf_b_size.f90 sourcefile~penf_global_parameters_variables.f90->sourcefile~penf_stringify.f90 sourcefile~penf_stringify.f90->sourcefile~penf.f90
Help

Source Code


Source Code

!< PENF's testing program.
program compact_real
!-----------------------------------------------------------------------------------------------------------------------------------
!< PENF's testing program.
!-----------------------------------------------------------------------------------------------------------------------------------
use penf
use, intrinsic :: ISO_FORTRAN_ENV, only : stdout=>OUTPUT_UNIT
!-----------------------------------------------------------------------------------------------------------------------------------

!-----------------------------------------------------------------------------------------------------------------------------------
implicit none
logical :: test_passed(3) !< List of passed tests.
!-----------------------------------------------------------------------------------------------------------------------------------

!-----------------------------------------------------------------------------------------------------------------------------------
call penf_init

test_passed = .false.

test_passed(1) = trim(str(n=1._R8P, compact=.true.))=='+0.1E+1'
print "(A,L1)", 'Compact 1.0: '//trim(str(n=1._R8P, compact=.true.))//', is correct? ', test_passed(1)

test_passed(2) = trim(str(n=1._R4P/3._R4P, compact=.true.))=='+0.333333E+0'
print "(A,L1)", 'Compact 1.0/3.0: '//trim(str(n=1._R4P/3._R4P, compact=.true.))//', is correct? ', test_passed(2)

test_passed(3) = trim(str(n=1._R16P/4._R16P, compact=.true.))=='+0.25E+0'
print "(A,L1)", 'Compact 1.0/4.0: '//trim(str(n=1._R16P/4._R16P, compact=.true.))//', is correct? ', test_passed(3)

write(stdout, "(A,L1)") new_line('a')//'Are all tests passed? ', all(test_passed)
stop
!-----------------------------------------------------------------------------------------------------------------------------------
endprogram compact_real