View previous topic :: View next topic |
Author |
Message |
Ryan
Joined: 25 Feb 2016 Posts: 110
|
Posted: Sun Sep 01, 2019 11:18 am Post subject: Bitwise xor |
|
|
I'm looking to xor two integers together in Fortran, is there a function in FTN95 to do this? |
|
Back to top |
|
 |
JohnCampbell
Joined: 16 Feb 2006 Posts: 2615 Location: Sydney
|
Posted: Sun Sep 01, 2019 11:53 am Post subject: |
|
|
IEOR (i,j) |
|
Back to top |
|
 |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2402 Location: Yateley, Hants, UK
|
Posted: Sun Sep 01, 2019 12:18 pm Post subject: |
|
|
There's a whole slew of such functions introduced in Fortran 90 and referenced in FTN95.chm. In addition, FTN77 had a few functions for setting and reading individual bits - see the FTN77 Library Reference Manual in the support section of the website.
Eddie |
|
Back to top |
|
 |
Ryan
Joined: 25 Feb 2016 Posts: 110
|
Posted: Sun Sep 01, 2019 7:04 pm Post subject: |
|
|
Thanks both, I did check the docs by searching for XOR couldn't find it. |
|
Back to top |
|
 |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2402 Location: Yateley, Hants, UK
|
Posted: Sun Sep 01, 2019 8:29 pm Post subject: |
|
|
Ryan,
I couldn't find it either, as FTN95.CHM doesn't have the sort of language guide that you used to get with printed documentation. I found a whole lot of information on bit operations here:
https://rosettacode.org/wiki/Bitwise_operations#Fortran
which gives the Fortran 90 routines as well as IEOR for all the related operations.
Eddie |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
|
Back to top |
|
 |
|