home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / fortran / 5177 < prev    next >
Encoding:
Text File  |  1993-01-25  |  1.9 KB  |  55 lines

  1. Newsgroups: comp.lang.fortran
  2. Path: sparky!uunet!nih-csl!helix.nih.gov!rvenable
  3. From: rvenable@helix.nih.gov (Richard M. Venable)
  4. Subject: Re: IAND(I,J) IOR(I,J) ???
  5. Message-ID: <1993Jan25.181908@helix.nih.gov>
  6. Sender: postman@alw.nih.gov (AMDS Postmaster)
  7. Reply-To: rvenable@helix.nih.gov (Richard M. Venable)
  8. Organization: National Institutes of Health
  9. References: <1jv0c0INNeco@rs2.hrz.th-darmstadt.de> <1993Jan25.191236.27552@sun1x.actc.res.utc.com>
  10. Date: Mon, 25 Jan 1993 23:19:08 GMT
  11. Lines: 42
  12.  
  13. In article <1993Jan25.191236.27552@sun1x.actc.res.utc.com>,
  14. mark@sun1x.actc.res.utc.com (Mark Stucky) writes:
  15.  
  16. |> kroeker@oc1.oc.chemie.th-darmstadt.de (Martin Kroeker) writes:
  17. |> : Could somebody please point me to a fortran source code that
  18. provides the
  19. |> : functionality of the non-standard functions IAND, IOR, IEOR and
  20. BTEST ?
  21. |> : I am trying to port a database application from a soon-to-be-junked
  22. IBM
  23. |> : mainframe to a workstation where the fortran compiler is in fact
  24. f2c, and my
  25. |> : own attempts at these bit-handling functions have failed
  26. miserably.
  27. |> : Thanks in advance,
  28. |> : Martin
  29. |> 
  30. |> Here's some...
  31. |> 
  32. |>       INTEGER*2 FUNCTION IAND(I1,I2)
  33. |> C BITWISE LOGICAL FUNCTIONS - MAY HAVE TO BE CHANGED
  34. |> C  ACCORDING TO A GIVEN SYSTEM'S IMPLEMENTATION
  35. |>       INTEGER*2 I1,I2
  36. |>       IAND = I1.AND.I2
  37. |>       RETURN
  38. |>       END
  39.  
  40.     [similar examples deleted]
  41.  
  42. The problem here is that while LOGICAL .and. is quite standard,
  43. BITWISE .and. is not part of the f77 standard, although widely
  44. implemented.  The same applies to .or., .not., etc.  The above
  45. will probably work on most (but not all) complilers, so be warned.
  46.  
  47. -----------------------------------------------------------------
  48.  Rick Venable                  |    "Eschew
  49.  FDA/CBER Biophysics Lab       |   Obfuscation"  
  50.  rvenable@helix.nih.gov        |         -- the Phantom Nerd   
  51. -----------------------------------------------------------------
  52.  
  53.  
  54.  
  55.