Silverfrost Forums

Welcome to our forums

Bitwise xor

1 Sep 2019 10:18 #24292

I'm looking to xor two integers together in Fortran, is there a function in FTN95 to do this?

1 Sep 2019 10:53 #24293

IEOR (i,j)

1 Sep 2019 11:18 #24294

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

1 Sep 2019 6:04 #24295

Thanks both, I did check the docs by searching for XOR couldn't find it.

1 Sep 2019 7:29 #24296

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

Please login to reply.