File: intrinsics_183.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 (21 lines) | stat: -rw-r--r-- 512 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
program intrinsics_183
    integer :: a1 = 3 
    integer :: a2 = 2
    integer :: a3 = 1
    integer :: a4 = -5
    integer(8) :: a = 20

    print*, ibits(3, 2, 1)
    if (ibits(3, 2, 1) /= 0) error stop
    print*, ibits(-5, 2, 2)
    if (ibits(-5, 2, 2) /= 2) error stop

    print*, ibits(a1, a2, a3)
    if (ibits(a1, a2, a3) /= 0) error stop
    print*, ibits(a4, a2, a2)
    if (ibits(a4, a2, a2) /= 2) error stop

    print*, ibits(a, 2_4, 2_4) 
    if (ibits(a, 2_4, 2_4) /= 1) error stop

end program