Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

How to specify signed/unsigned value in F90
Hi all,

I have an array of integer*2 values.  How could I say to F90 that values
range from 0 to 65535 (and not from -32767 to 32767).

Thanks

Denis

Report this thread to moderator Post Follow-up to this message
Old Post
denis
11-25-04 08:57 PM


RE: How to specify signed/unsigned value in F90
In a previous article, denis <dpithon@freenospam.fr> wrote:
>Hi all,
>
>I have an array of integer*2 values.  How could I say to F90 that values
>range from 0 to 65535 (and not from -32767 to 32767).
>
>Thanks
>
>Denis

simple way --

Integer*4 I4
integer*2 i2
..
i4=i2
if(i4.lt.0)i4=i4+32768

.. but I sure there's a compicated way out there just
waiting to pounce!

Chris

Report this thread to moderator Post Follow-up to this message
Old Post
meek@skyway.usask.ca
11-25-04 08:57 PM


Re: How to specify signed/unsigned value in F90
There is no pre-defined unsigned integer. If it is important one can be
defined using F90. The value can be stored as an integer and operators can
be "overloaded".

David.T.Croft@AdsorptionProcessModeling.com

"denis" <dpithon@freenospam.fr> wrote in message
news:41a614bf$0$30293$626a14ce@news.free.fr...
> Hi all,
>
> I have an array of integer*2 values.  How could I say to F90 that values
> range from 0 to 65535 (and not from -32767 to 32767).
>
> Thanks
>
> Denis



Report this thread to moderator Post Follow-up to this message
Old Post
David T. Croft, Ph.D.
11-26-04 09:02 AM


Re: How to specify signed/unsigned value in F90
denis <dpithon@freenospam.fr> wrote in message news:<41a614bf$0$30293$626a14ce@news.free.fr
>...
> Hi all,
>
> I have an array of integer*2 values.  How could I say to F90 that values
> range from 0 to 65535 (and not from -32767 to 32767).
>
> Thanks
>
> Denis

In standard Fortran, you can't.  If you are using Sun f90/f95,
you could use the intrinsic function TRANSFER, where the second
argument is an UNSIGNED*2 variable.  If the array is static, you
could EQUIVALENCE it to an UNSIGNED*2 array.

Sincerely,
Bob Corbett

Report this thread to moderator Post Follow-up to this message
Old Post
Robert Corbett
11-30-04 08:58 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Fortran archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:02 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.