BLT(3) - [BIT:COMPARE] Bitwise less than
result = blt(i,j)
elemental logical function blt(i, j)integer(kind=**),intent(in) :: i integer(kind=**),intent(in) :: j
BOZ constants must have a value valid for the integer kind available with the most bits on the current platform.
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
BLT(3) determines whether an integer is bitwise less than another.
o I : Shall be of integer type or a BOZ literal constant. o J : Shall be of integer type or a BOZ constant.
The return value is of type logical and of the default kind.
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(z1000, z101011010) ! see the BGE() description for an extended description ! of related informationResults:end program demo_blt
> -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
Fortran 2008
BGE(3), BGT(3), BLE(3)
Fortran intrinsic descriptions (license: MIT) @urbanjost
Nemo Release 3.1 | blt (3fortran) | November 02, 2024 |