Google Groups Home
Help | Sign in
Message from discussion Bitwise logical functions in gfortran
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
James Van Buskirk  
View profile  
 More options May 13 2008, 7:15 pm
Newsgroups: comp.lang.fortran
From: "James Van Buskirk" <not_va...@comcast.net>
Date: Tue, 13 May 2008 17:15:17 -0600
Local: Tues, May 13 2008 7:15 pm
Subject: Bitwise logical functions in gfortran
gfortran documents the intrinsic extension functions AND, OR, and
XOR.  However, the documentation gives the impression that it
permits mixed-mode operations between INTEGER and LOGICAL types.
Also it doesn't emphasize that the functions are not elemental.

C:\gfortran\test\intrinsics>type logical1.f90
program L
   write(*,*) and(3_1,[1,2,3,4])
   write(*,*) and(.TRUE._1, 1_1)
end program L

C:\gfortran\test\intrinsics>gfortran logical1.f90 -ological1
logical1.f90:2.22:

   write(*,*) and(3_1,[1,2,3,4])
                     1
Error: 'j' argument of 'and' intrinsic at (1) must be a scalar
logical1.f90:3.27:

   write(*,*) and(.TRUE._1, 1_1)
                          1
Error: 'i' and 'j' arguments of 'and' intrinsic at (1) must have the same
type

Not to mention that the functions don't seem to work for LOGICAL inputs:

C:\gfortran\test\intrinsics>type logical2.f90
program L
   write(*,*) and(.TRUE._1, .TRUE._1)
   write(*,*) or(.TRUE._1, .TRUE._1)
   write(*,*) xor(.TRUE._1, .TRUE._1)
end program L

C:\gfortran\test\intrinsics>gfortran logical2.f90 -ological2
logical2.f90:5.13:

end program L
            1
Internal Error at (1):
gfc_range_check(): Bad type

--
write(*,*) transfer((/17.392111325966148d0,6.5794487871554595D-85, &
6.0134700243160014d-154/),(/'x'/)); end


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google