File: format3.f90

package info (click to toggle)
lfortran 0.58.0-4
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 54,512 kB
  • sloc: cpp: 162,179; f90: 68,251; python: 17,476; ansic: 6,278; yacc: 2,334; sh: 1,317; fortran: 892; makefile: 33; javascript: 15
file content (29 lines) | stat: -rw-r--r-- 700 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
! 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
    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