File: intrinsics_157.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 (82 lines) | stat: -rw-r--r-- 2,329 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
program intrinsics_157
    logical, parameter :: l1 = ble(10, 5)
    logical, parameter :: l2 = ble(10_8, -5_8)
    integer:: k1 = 10
    integer:: k2 = 5
    integer:: k3 = -5
    integer:: k4 = 15
    integer:: k5 = 0
    integer:: k6 = -15
    logical:: f = .false.
    logical, parameter :: ar1(4) = ble([1, 2, 4, 5], 3)
    logical, parameter :: ar2(4) = ble([-1, 3, -7, 5], -3)

    integer :: arr1(4)
    integer :: arr2(3)
    logical :: res(3)

    arr1 = [11, 2, 13, 4]
    arr2 = [-5_8, 7_8, 0_8]

    print *, l1
    if (l1 .neqv. .false.) error stop

    print *, l2
    if (l2 .neqv. .true.) error stop

    print *, ar1
    if (any(ar1) .neqv. .true.) error stop

    print *, ar2
    if (any(ar2) .neqv. .true.) error stop

    print*, ble(10, 5)
    if (ble(10, 5) .neqv. .false.) error stop
    print*, ble(-5, 10)
    if (ble(-5, 10) .neqv. .false.) error stop
    print*, ble(-5, 5)
    if (ble(-5, 5) .neqv. .false.) error stop
    print*, ble(-5, -15)
    if (ble(-5, -15) .neqv. .false.) error stop
    print*, ble(5, 15)
    if (ble(5, 15) .neqv. .true.) error stop
    print*, ble(5, -15)
    if (ble(5, -15) .neqv. .true.) error stop
    print*, ble(0, -5)
    if (ble(0, -5) .neqv. .true.) error stop
    print*, ble(0, 5)
    if (ble(0, 5) .neqv. .true.) error stop
    print*, ble(-5, 0)
    if (ble(-5, 0) .neqv. .false.) error stop
    print*, ble(5, 0)
    if (ble(5, 0) .neqv. f) error stop

    print*, ble(k1, k2)
    if (ble(k1, k2) .neqv. .false.) error stop
    print*, ble(k3, k1)
    if (ble(k3, k1) .neqv. .false.) error stop
    print*, ble(k3, k3)
    if (ble(k3, k3) .neqv. .true.) error stop
    print*, ble(k3, k6)
    if (ble(k3, k6) .neqv. .false.) error stop
    print*, ble(k2, k4)
    if (ble(k2, k4) .neqv. .true.) error stop
    print*, ble(k2, k6)
    if (ble(k2, k6) .neqv. .true.) error stop
    print*, ble(k5, k3)
    if (ble(k5, k3) .neqv. .true.) error stop
    print*, ble(k5, k2)
    if (ble(k5, k2) .neqv. .true.) error stop
    print*, ble(k3, k5)
    if (ble(k3, k5) .neqv. .false.) error stop
    print*, ble(k2, k5)
    if (ble(k2, k5) .neqv. f) error stop

    print *, ble(arr1, 5)
    if (any(ble(arr1, 5) .neqv. .true.) .neqv. .true.) error stop

    res = ble(arr2, k5)
    print *, res
    if (any(res .neqv. .true.) .neqv. .true.) error stop

end program