forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Error in BIT_SIZE intrinsic function?

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
Anonymous
Guest





PostPosted: Sun Jun 18, 2006 5:24 am    Post subject: Error in BIT_SIZE intrinsic function? Reply with quote

Hello everybody,

As a novice Salfort FTN95 user I just discovered the following strange phenomenon.
Consider the following piece of code:

MODULE INTEGER_KINDS
INTEGER, PARAMETER :: bytes_1 = SELECTED_INT_KIND(2)
INTEGER, PARAMETER :: bytes_2 = SELECTED_INT_KIND(4)
INTEGER, PARAMETER :: bytes_4 = SELECTED_INT_KIND(9)
INTEGER, PARAMETER :: bytes_8 = SELECTED_INT_KIND(1Cool
END MODULE INTEGER_KINDS

PROGRAM MAIN
USE INTEGER_KINDS
INTEGER (KIND=bytes_1) :: n=127
INTEGER (KIND=bytes_2) :: nn=32767
INTEGER (KIND=bytes_4) :: nnn=2147483647
INTEGER (KIND=bytes_8) :: nnnn=9223372036854775807_bytes_8

PRINT *, n, BIT_SIZE(n)
PRINT *, nn, BIT_SIZE(nn)
PRINT *, nnn, BIT_SIZE(nnn)
PRINT *, nnnn, BIT_SIZE(nnnn)
STOP
END

This produces the result:
127 8
32767 16
2147483647 32
9223372036854775807 32

I expected the last value to be 64 in stead of 32!!!
What is happening here?
Am I doing something wrong?

Hoping for a quick feedback!
Kind regards,
Lucas.
Back to top
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7925
Location: Salford, UK

PostPosted: Mon Jun 19, 2006 1:27 am    Post subject: Error in BIT_SIZE intrinsic function? Reply with quote

Lucas

FTN95 is not yet fully functional for INTEGER*8 so you may find some intrinsics that do not support 64 bit integers.

However, BIT_SIZE should work OK from version 4.91.
Back to top
View user's profile Send private message AIM Address
Anonymous
Guest





PostPosted: Mon Jun 19, 2006 4:55 am    Post subject: Error in BIT_SIZE intrinsic function? Reply with quote

Ok Paul,

Thanks for the info.
Any idea when version 4.91 should be available?
Back to top
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7925
Location: Salford, UK

PostPosted: Mon Jun 19, 2006 5:19 am    Post subject: Error in BIT_SIZE intrinsic function? Reply with quote

Lucas

It is already available.
See the Announcements.
Back to top
View user's profile Send private message AIM Address
Anonymous
Guest





PostPosted: Mon Jun 19, 2006 6:04 am    Post subject: Error in BIT_SIZE intrinsic function? Reply with quote

Absolutely right, Paul.

I must have overlooked it, due to my enthousiasm, or the heat...
Sorry.
But thanks for correcting me.

Lucas.
Back to top
Anonymous
Guest





PostPosted: Mon Jun 19, 2006 6:30 am    Post subject: Error in BIT_SIZE intrinsic function? Reply with quote

Well Paul, you were right again.

I have now installed version 4.91 of FTN95PE, and the result of the BIT_SIZE intrinsic function is now indeed 64 for INTEGER*8 variables.
However I had to install the Microsoft .NET v.1.1.4423 first, otherwise I couldn't do the upgrade from 4.90 to 4.91.

Thanks again for pointing me in the right direction!
Lucas.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group