1 LOGICAL FUNCTION LSAME( CA, CB )
3 * -- LAPACK auxiliary routine (version 2.0) --
4 * Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
5 * Courant Institute, Argonne National Lab, and Rice University
8 * .. Scalar Arguments ..
15 * LSAME returns .TRUE. if CA is the same letter as CB regardless of
21 * CA (input) CHARACTER*1
22 * CB (input) CHARACTER*1
23 * CA and CB specify the single characters to be compared.
25 * =====================================================================
27 * .. Intrinsic Functions ..
31 INTEGER INTA, INTB, ZCODE
33 * .. Executable Statements ..
35 * Test if the characters are equal
41 * Now test for equivalence if both characters are alphabetic.
45 * Use 'Z' rather than 'A' so that ASCII can be detected on Prime
46 * machines, on which ICHAR returns a value with bit 8 set.
47 * ICHAR('A') on Prime machines returns 193 which is the same as
48 * ICHAR('A') on an EBCDIC machine.
53 IF( ZCODE.EQ.90 .OR. ZCODE.EQ.122 ) THEN
55 * ASCII is assumed - ZCODE is the ASCII code of either lower or
58 IF( INTA.GE.97 .AND. INTA.LE.122 ) INTA = INTA - 32
59 IF( INTB.GE.97 .AND. INTB.LE.122 ) INTB = INTB - 32
61 ELSE IF( ZCODE.EQ.233 .OR. ZCODE.EQ.169 ) THEN
63 * EBCDIC is assumed - ZCODE is the EBCDIC code of either lower or
66 IF( INTA.GE.129 .AND. INTA.LE.137 .OR.
67 $ INTA.GE.145 .AND. INTA.LE.153 .OR.
68 $ INTA.GE.162 .AND. INTA.LE.169 ) INTA = INTA + 64
69 IF( INTB.GE.129 .AND. INTB.LE.137 .OR.
70 $ INTB.GE.145 .AND. INTB.LE.153 .OR.
71 $ INTB.GE.162 .AND. INTB.LE.169 ) INTB = INTB + 64
73 ELSE IF( ZCODE.EQ.218 .OR. ZCODE.EQ.250 ) THEN
75 * ASCII is assumed, on Prime machines - ZCODE is the ASCII code
76 * plus 128 of either lower or upper case 'Z'.
78 IF( INTA.GE.225 .AND. INTA.LE.250 ) INTA = INTA - 32
79 IF( INTB.GE.225 .AND. INTB.LE.250 ) INTB = INTB - 32