File: format3.f90

package info (click to toggle)
lfortran 0.45.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 46,332 kB
  • sloc: cpp: 137,068; f90: 51,260; python: 6,444; ansic: 4,277; yacc: 2,285; fortran: 806; sh: 524; makefile: 30; javascript: 15
file content (30 lines) | stat: -rw-r--r-- 751 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
! tests for 'EN' formatting
program format3
    ! standard positive values
    real :: num1, num2, num3, small_num4, under_power_10
    ! standard negative values
    real :: neg_num1, small_neg_num4
    ! edge cases, doesn't work currently
    real :: zero1
    num1 = 12345.6789
    num2 = 0.000123456789
    num3 = 1234.5678
    ! small_num4 = 0.000123456789
    ! under_power_10 = 999.9999

    neg_num1 = -1234.5678
    small_neg_num4 = -0.000123456789
    zero1 = 0.0

    print '(EN12.4)', num1
    print '(EN12.4)', num2
    print '(EN10.4)', num3
    ! print '(EN10.4)', small_num4
    ! print '(EN10.4)', under_power_10

    print '(EN12.4)', neg_num1
    print '(EN15.5)', small_neg_num4

    ! print '(EN10.4)', zero1

end program format3