lge(x, y): léxicamente mayor o igual¶
Léxicamente mayor que o igual.
Declaración¶
Sintaxis¶
retval = lge(x, y)
function lge(x, y)
Argumentos¶
x
valor de entrada de tipo carácter.
y
valor de entrada de tipo carácter.
x
e y
pueden ser vistos como la cadena A y la cadena B.
Valores devueltos¶
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.
Descripción¶
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
Ejemplos¶
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
Result:
false
true