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: 2554 Location: Sydney
|
Posted: Sun Sep 01, 2019 11:53 am Post subject: |
|
|
IEOR (i,j) |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 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: 2388 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: 7929 Location: Salford, UK
|
|
Back to top |
|
|
John-Silver
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Fri Sep 13, 2019 7:47 pm Post subject: |
|
|
I've had this problem before when trying to follow posts including reference to 'XOR' and being unableto find it by searching the online documentation.
Any raw newbie would be flumoxed (a word not nearly enough used in this modern world - too many letters to be easily texted I guess !) ... anyway, they'd be flumoxed on this post because Paul's posted link makes no reference to XOR !
Because ... it's equivalent in ftn95 appears to be IEOR!!!
... and if you can't find it that doesn't mean your a donkey or does it
I Claudius ? IEOR ?
What's the point of IEOR (XOR) anyway, what practical applications does it have / is it used for ?
There doesn't seem to be (that I can find anyway) much documentation anywhere about it's useful uses, not just in the ftn95 documentation.
After all, the best way to get people to use new features is to 'sell' them (them being Joe Blogs's) via expounding their PRACTICAL uses. _________________ ''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... " |
|
Back to top |
|
|
|