[comp.lang.fortran] Fortran 77 Intrinsic Functions

beamishd@ccvax.ucd.ie (10/08/90)

I am looking for a list of the intrinsic functions available with standard
ANSI Fortran 77. Can someone tell me where to find such a list ? Functions I 
am specifically looking at are bit manipulation functions.
	     Thanks

Norman Beamish                            
Dept. of Electrical & Electronic Engineering
University College, Dublin
Belfield, Dublin 4
Ireland                                    NBEAME91@irlearn.bitnet
					   NBEAME91@irlearn.ucd.ie
					   beamishd@ccvax.bitnet
  			                   beamishd@ccvax.ucd.ie
	                                  Voice +353-1-693244 Ext.1964
					  Fax   +353-1-830921

ddh@hare.cdc.com (Dan Horsfall) (10/09/90)

In article <6724.27106469@ccvax.ucd.ie> beamishd@ccvax.ucd.ie writes:
> I am looking for a list of ...  bit manipulation functions.
> 	     Thanks
> 
> Norman Beamish                            
> Dublin Ireland

You won't find such a thing.  FORTRAN deals with word-oriented units,
not bits; bits are (obviously, I hope) machine dependent.  Now, most
compiler writers provide intrinsic functions of some type, or even
source language constructs for manipulating bits, but ANSI 77 does not 
because it _can_ not.

--

wsb@boise.Eng.Sun.COM (Walt Brainerd) (10/10/90)

In article <26720@shamash.cdc.com>, ddh@hare.cdc.com (Dan Horsfall) writes:
> In article <6724.27106469@ccvax.ucd.ie> beamishd@ccvax.ucd.ie writes:
> > I am looking for a list of ...  bit manipulation functions.
> > 	     Thanks
> > 
> > Norman Beamish                            
> > Dublin Ireland
> 
> You won't find such a thing.  FORTRAN deals with word-oriented units,
> not bits; bits are (obviously, I hope) machine dependent.  Now, most
> compiler writers provide intrinsic functions of some type, or even
> source language constructs for manipulating bits, but ANSI 77 does not 
> because it _can_ not.
> 
> --

This states exactly why bit manipulation was not in F77.
However, as mentioned by another poster, such functions are in
the MIL STD; therefore there was pressure to include them in F90.
Since the charter of the standard development is portability,
the "bit" manipulation functions actually work on integers
in the following way:  You convert the integer(s) to a bit
string that looks like the binary representation of the integer,
then do the "logical" operation bit-by-bit, then convert
the result back to integer.  Too bad if your internal representation
of integers does not happen to match the model given in the
standard, but it should in most??? cases.

The names are all wrong, because the MIL STD ones were adopted.
For example "and" is IAND and the one called MVBITS actually
copies bits!
--
Walt Brainerd        Sun Microsystems, Inc.
wsb@eng.sun.com      MS MTV 5-40
                     Mountain View, CA 94043
                     415/336-5991