lge(x, y): Lexically Greater or Equal

Lexically greater than or equal.

Declaration

Sintaxe

retval = lge(x, y)
function lge(x, y)

Argumentos

x input value of type character.

y input value of type character.

x and y can be seen as string A and string B.

Valores de retorno

The return value is of logical true or false type.

True if x string is lexically greater than or equal to y.

False if they are not.

Descrição

lge(x, y) determines if input string x is lexically greater than or equal to input string y. The two strings in comparison are interpreted as containing ASCII character codes.

Tipos

Argument types should be of type character literal.

module lfortran_intrinsic_string
    use, intrinsic :: iso_fortran_env, only: i64 => int64
implicit none

interface repeat
    module procedure repeati32, repeati64
end interface

contains

function lge(x, y) result(r)
    character(len=*),intent(in) :: x
    character(len=*),intent(in) :: y
    logical :: r
end function

Exemplos

program intrinsics_lge
    implicit none
    character(len = 10) :: s1 = 'abcde'
	character(len = 10) :: s2 = 'xyz'
    character(len = 10) :: s3 = 'AB'
	character(len = 10) :: s4 = 'AAB'
	print *, lge(s1, s2)
end program

Resultado:

false
true

Veja Também

len_trim.