> ----- Original Message -----
> From: "Catherine Moroney" <[log in to unmask]>
> To: <[log in to unmask]>
> Sent: Wednesday, March 01, 2000 7:01 PM
> Subject: signed vs. unsigned ints in Ftn90
> > This is a very elementary question I know, but I just realized that it's
> > something that I really should understand.
> >
> > How does Fortran handle signed vs. unsigned integers, given that there's
> > only a single integer datatype?
>
> There is no specific standard support for unsigned data types.
>
> If you assign a value > 127 to an
> > integer*1 variable, does Fortran then assume that it's going to be an
> > unsigned int and treat it accordingly?
>
> The only standard Fortran data type which normally occupies 1 byte is
> CHARACTER. There is no specific support for storing numeric values in
> CHARACTER beyond what is implied by the intrinsic conversions to INTEGER
> such as ICHAR().
.... beyond what is available via the TRANSFER function.
Nevertheless, you can define your own unsigned integer type, and you
can define operations (e.g., add, subtract, etc) to be performed on data
of that type.
> > Catherine
> > ------------------------------------------------------------------
> > Catherine Moroney ph: (520) 626-5123
> > Institute of Atmospheric Physics fax: (520) 621-6833
> > University of Arizona [log in to unmask]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|