Manual Reference Pages  - blt (3fortran)

NAME

BLT(3) - [BIT:COMPARE] Bitwise less than

SYNOPSIS

result = blt(i,j)

         elemental logical function blt(i, j)

integer(kind=**),intent(in) :: i integer(kind=**),intent(in) :: j

CHARACTERISTICS

o I is an integer of any kind or a BOZ-literal-constant
o J is an integer of any kind or a BOZ-literal-constant, not necessarily the same as I.
o the result is of default logical kind
BOZ constants must have a value valid for the integer kind available with the most bits on the current platform.

DESCRIPTION

BLT(3) determines whether an integer is bitwise less than another.

OPTIONS

o I : Shall be of integer type or a BOZ literal constant.
o J : Shall be of integer type or a BOZ constant.

RESULT

The return value is of type logical and of the default kind.

EXAMPLES

Sample program:

    program demo_blt
    use,intrinsic :: iso_fortran_env, only : int8, int16, int32, int64
    implicit none
    integer            :: i
    integer(kind=int8) :: byte
      ! Compare some one-byte values to 64.
       ! Notice that the values are tested as bits not as integers
       ! so sign bits in the integer are treated just like any other
       do i=-128,127,32
          byte=i
          write(*,’(sp,i0.4,*(1x,1l,1x,b0.8))’)i,blt(byte,64_int8),byte
       enddo
      ! BOZ literals
       write(*,*)blt(z’1000’, z’101011010’)
       ! see the BGE() description for an extended description
       ! of related information

end program demo_blt

Results:

       > -0128  F 10000000
       > -0096  F 10100000
       > -0064  F 11000000
       > -0032  F 11100000
       > +0000  T 00000000
       > +0032  T 00100000
       > +0064  F 01000000
       > +0096  F 01100000
       > T

STANDARD

Fortran 2008

SEE ALSO

BGE(3), BGT(3), BLE(3)

Fortran intrinsic descriptions (license: MIT) @urbanjost


Nemo Release 3.1 blt (3fortran) November 02, 2024
Generated by manServer 1.08 from 865d3f07-9aed-4667-b673-2e7f30e710f8 using man macros.