Article View: comp.lang.fortran
Article #4501Re: IAND(I,J) IOR(I,J) ???
From: 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 -----------------------------------------------------------------
Technical Details
Message-ID:
<1993Jan25.181908@helix.nih.gov>Path:
arc1-ca.pugleaf.net!sparky!uunet!nih-csl!helix.nih.gov!rvenableReferences:
<1jv0c0INNeco@rs2.hrz.th-darmstadt.de> <1993Jan25.191236.27552@sun1x.actc.res.utc.com>Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.fortran Path: arc1-ca.pugleaf.net!sparky!uunet!nih-csl!helix.nih.gov!rvenable From: rvenable@helix.nih.gov (Richard M. Venable) Subject: Re: IAND(I,J) IOR(I,J) ??? Message-ID: <1993Jan25.181908@helix.nih.gov> Sender: postman@alw.nih.gov (AMDS Postmaster) Reply-To: rvenable@helix.nih.gov (Richard M. Venable) Organization: National Institutes of Health References: <1jv0c0INNeco@rs2.hrz.th-darmstadt.de> <1993Jan25.191236.27552@sun1x.actc.res.utc.com> Date: Mon, 25 Jan 1993 23:19:08 GMT Lines: 42