Thread View: comp.lang.fortran
3 messages
3 total messages
Started by Martin Kroeker
Sun, 24 Jan 1993 21:06
IAND(I,J) IOR(I,J) ???
Author: Martin Kroeker
Date: Sun, 24 Jan 1993 21:06
Date: Sun, 24 Jan 1993 21:06
12 lines
1165 bytes
1165 bytes
Could somebody please point me to a fortran source code that provides the functionality of the non-standard functions IAND, IOR, IEOR and BTEST ? I am trying to port a database application from a soon-to-be-junked IBM mainframe to a workstation where the fortran compiler is in fact f2c, and my own attempts at these bit-handling functions have failed miserably. Thanks in advance, Martin -- Dipl.Ing Martin Kroeker kroeker@oc1.oc.chemie.th-darmstadt.de Inst. f. Organ. Chemie martin@oc2.oc.chemie.th-darmstadt.de Univ. (TH) Darmstadt db7p@mvs.hrz.th-darmstadt.de Germany (in real life: <not determined> )
Re: IAND(I,J) IOR(I,J) ???
Author: Mark Stucky
Date: Mon, 25 Jan 1993 19:12
Date: Mon, 25 Jan 1993 19:12
42 lines
1787 bytes
1787 bytes
kroeker@oc1.oc.chemie.th-darmstadt.de (Martin Kroeker) writes:
: Could somebody please point me to a fortran source code that provides the
: functionality of the non-standard functions IAND, IOR, IEOR and BTEST ?
: I am trying to port a database application from a soon-to-be-junked IBM
: mainframe to a workstation where the fortran compiler is in fact f2c, and my
: own attempts at these bit-handling functions have failed miserably.
: Thanks in advance,
: Martin
Here's some...
INTEGER*2 FUNCTION IAND(I1,I2)
C BITWISE LOGICAL FUNCTIONS - MAY HAVE TO BE CHANGED
C ACCORDING TO A GIVEN SYSTEM'S IMPLEMENTATION
INTEGER*2 I1,I2
IAND = I1.AND.I2
RETURN
END
INTEGER*2 FUNCTION IXOR(I1,I2)
INTEGER*2 I1,I2
IXOR = I1.XOR.I2
RETURN
END
INTEGER*2 FUNCTION IOR(I1,I2)
INTEGER*2 I1,I2
IOR = I1.OR.I2
RETURN
END
INTEGER*2 FUNCTION INOT(I1)
INTEGER*2 I1
INOT = .NOT.I1
RETURN
END
--
------------------------------------------------------------------------------
| Mark Stucky | Email: |
| United Technologies Research Center | mark@ardnt1.res.utc.com |
| East Hartford, CT. |or mbs@utrcgw.res.utc.com |
Re: IAND(I,J) IOR(I,J) ???
Author: Richard M. Venable
Date: Mon, 25 Jan 1993 23:19
Date: Mon, 25 Jan 1993 23:19
39 lines
1984 bytes
1984 bytes
In article <1993Jan25.191236.27552@sun1x.actc.res.utc.com>, mark@sun1x.actc.res.utc.com (Mark Stucky) writes: |> kroeker@oc1.oc.chemie.th-darmstadt.de (Martin Kroeker) writes: |> : Could somebody please point me to a fortran source code that provides the |> : functionality of the non-standard functions IAND, IOR, IEOR and BTEST ? |> : I am trying to port a database application from a soon-to-be-junked IBM |> : mainframe to a workstation where the fortran compiler is in fact f2c, and my |> : own attempts at these bit-handling functions have failed miserably. |> : Thanks in advance, |> : Martin |> |> Here's some... |> |> INTEGER*2 FUNCTION IAND(I1,I2) |> C BITWISE LOGICAL FUNCTIONS - MAY HAVE TO BE CHANGED |> C ACCORDING TO A GIVEN SYSTEM'S IMPLEMENTATION |> INTEGER*2 I1,I2 |> IAND = I1.AND.I2 |> RETURN |> END [similar examples deleted] The problem here is that while LOGICAL .and. is quite standard, BITWISE .and. is not part of the f77 standard, although widely implemented. The same applies to .or., .not., etc. The above will probably work on most (but not all) complilers, so be warned. ----------------------------------------------------------------- Rick Venable | "Eschew FDA/CBER Biophysics Lab | Obfuscation" rvenable@helix.nih.gov | -- the Phantom Nerd -----------------------------------------------------------------
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads