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

  1. Newsgroups: comp.lang.fortran
  2. Path: sparky!uunet!gatech!darwin.sura.net!newsserver.jvnc.net!yale.edu!yale!actcnews!sun1x!mark
  3. From: mark@sun1x.actc.res.utc.com (Mark Stucky)
  4. Subject: Re: IAND(I,J) IOR(I,J) ???
  5. Message-ID: <1993Jan25.191236.27552@sun1x.actc.res.utc.com>
  6. Organization: United Technologies Research Center
  7. References: <1jv0c0INNeco@rs2.hrz.th-darmstadt.de>
  8. Date: Mon, 25 Jan 1993 19:12:36 GMT
  9. Lines: 42
  10.  
  11. kroeker@oc1.oc.chemie.th-darmstadt.de (Martin Kroeker) writes:
  12. : Could somebody please point me to a fortran source code that provides the
  13. : functionality of the non-standard functions IAND, IOR, IEOR and BTEST ?
  14. : I am trying to port a database application from a soon-to-be-junked IBM
  15. : mainframe to a workstation where the fortran compiler is in fact f2c, and my
  16. : own attempts at these bit-handling functions have failed miserably.
  17. : Thanks in advance,
  18. : Martin
  19.  
  20. Here's some...
  21.  
  22.       INTEGER*2 FUNCTION IAND(I1,I2)
  23. C BITWISE LOGICAL FUNCTIONS - MAY HAVE TO BE CHANGED
  24. C  ACCORDING TO A GIVEN SYSTEM'S IMPLEMENTATION
  25.       INTEGER*2 I1,I2
  26.       IAND = I1.AND.I2
  27.       RETURN
  28.       END
  29.  
  30.       INTEGER*2 FUNCTION IXOR(I1,I2)
  31.       INTEGER*2 I1,I2
  32.       IXOR = I1.XOR.I2
  33.       RETURN
  34.       END
  35.  
  36.       INTEGER*2 FUNCTION IOR(I1,I2)
  37.       INTEGER*2 I1,I2
  38.       IOR = I1.OR.I2
  39.       RETURN
  40.       END
  41.  
  42.       INTEGER*2 FUNCTION INOT(I1)
  43.       INTEGER*2 I1
  44.       INOT = .NOT.I1
  45.       RETURN
  46.       END
  47.  
  48. -- 
  49. ------------------------------------------------------------------------------
  50. | Mark Stucky                         | Email:                               |
  51. | United Technologies Research Center |     mark@ardnt1.res.utc.com          |
  52. | East Hartford, CT.                  |or   mbs@utrcgw.res.utc.com           |
  53.