Logicals converted to integers during reading
  Home FAQ Contact Sign in
 
Advanced search
MATCHING GROUPS



more...
POPULAR GROUPS

more...

found 47 articles for 0.011 sec
Re: Logicals converted to integers during reading     

Group: comp.lang.fortran · Group Profile · Search for Logicals converted to integers during reading in comp.lang.fortran
Author: beliavsky
Date: Jul 28, 2006 10:15

...I'd like to ask, if anybody knows what the standard says about the conversion of "F", "T", ".f.", and ".t." to integers during reading. For example: program test integer :: a read(*,*) a print *, "Value of a: ", a end program test The standard says that you can't do that. If ...
Show full article (0.92Kb) · Show article thread
Re: Logicals converted to integers during reading     

Group: comp.lang.fortran · Group Profile · Search for Logicals converted to integers during reading in comp.lang.fortran
Author: Steve Lionel
Date: Jul 28, 2006 09:09

... I'd like to ask, if anybody knows what the standard says about the conversion of "F", "T", ".f.", and ".t." to integers during reading. For example: program test integer :: a read(*,*) a print *, "Value of a: ", a end program test The standard says that you can't do that. If you do it...
Show full article (0.74Kb) · Show article thread
Re: Logicals converted to integers during reading     

Group: comp.lang.fortran · Group Profile · Search for Logicals converted to integers during reading in comp.lang.fortran
Author: Jugoslav Dujic
Date: Jul 28, 2006 07:03

...F", "T", ".f.", and ".t." to integers during reading. || For example: || || program test || || integer :: a || || read(*,*) a || print *, "Value of a: ", a || || end program test || || If ...it, and enter T or F, ifort 9 converts it to -1 or 0. Other || compilers... annoying, I must observe. (I mean, entire logical= integer stuff allowed in DEC and inheritants). ...
Show full article (1.06Kb) · Show article thread
Re: Logicals converted to integers during reading     

Group: comp.lang.fortran · Group Profile · Search for Logicals converted to integers during reading in comp.lang.fortran
Author: dpb
Date: Jul 28, 2006 06:47

...ask, if anybody knows what the standard says about the conversion of "F", "T", ".f.", and ".t." to integers during reading. For example: program test integer :: a read(*,*) a print *, "Value of a: ", a end program test If you run it, and enter T or F, ifort 9 converts it to -1 or 0. Other compilers (g95 on i686, f95 ...
Show full article (1.15Kb) · Show article thread
Re: Logicals converted to integers during reading     

Group: comp.lang.fortran · Group Profile · Search for Logicals converted to integers during reading in comp.lang.fortran
Author: Dave Weatherall
Date: Jul 30, 2006 22:38

...1 and very useful for adding additional status info into a logical/integer variable. Oops,! I've replied to Steve, who is only too aware of the above, rather than Glen. I think that is what TOPS-10 does also. But .TRUE. converted to integer, at least on TOPS-10, is -1. It sets all bits, but only tests one bit...
Show full article (1.01Kb) · Show article thread
Re: Logicals converted to integers during reading     

Group: comp.lang.forth · Group Profile · Search for Logicals converted to integers during reading in comp.lang.forth
Author: James Giles
Date: Jul 30, 2006 21:40

...'t change your usage of the logical in the fashion you desire (as...fact, my recommendation could guarantee the integer result you desire by allowing you ... demonstrates one of the properties of converted logical values that I believe more ...the same as NOT(FALSE). Given: Integer, parameter :: true = int(.true.), false =..., and I is an arbitrary integer value. I believe people would expect...
Show full article (2.73Kb) · Show article thread
Re: Logicals converted to integers during reading     

Group: comp.lang.fortran · Group Profile · Search for Logicals converted to integers during reading in comp.lang.fortran
Author: Gary Scott
Date: Jul 30, 2006 19:09

...used interchangeably with the concept of "logic 1". The intrinsic would be ... postulating some implementation of reverse logic. All this is irrelevant to the...the result. I most often use converted logicals as masks. A full ... to in the implementation defined integer model. (The correspondence between the ... my recommendation could guarantee the integer result you desire by allowing ...
Show full article (3.37Kb) · Show article thread
Re: Logicals converted to integers during reading     

Group: comp.lang.fortran · Group Profile · Search for Logicals converted to integers during reading in comp.lang.fortran
Author: Gary Scott
Date: Jul 30, 2006 08:39

...) zero is false. Remembering that integer add (and therefore negation of the ..., if there's a difference) LOGICAL(anInt) == .true. ! if anInt is not ... signed-magnitude is used for the integers. Why -1 instead of +1 if..., we need a logical to integer intrinsic that converts .true. to the... else on those other two integer styles. Weighing the alternatives gives ...
Show full article (4.43Kb) · Show article thread
Re: Logicals converted to integers during reading     

Group: comp.lang.fortran · Group Profile · Search for Logicals converted to integers during reading in comp.lang.fortran
Author: glen herrmannsfeldt
Date: Jul 29, 2006 23:27

... as binary as 0, 1 or 0,-1 and very useful for adding additional status info into a logical/integer variable. Oops,! I've replied to Steve, who is only too aware of the above, rather than Glen. I think that is what TOPS-10 does also. But .TRUE. converted to integer, at least on TOPS-10, is -1. It sets all bits, but only tests one bit. ...
Show full article (0.68Kb) · Show article thread
Re: Logicals converted to integers during reading     

Group: comp.lang.fortran · Group Profile · Search for Logicals converted to integers during reading in comp.lang.fortran
Author: Gary Scott
Date: Jul 29, 2006 10:21

...positive) zero is false. Remembering that integer add (and therefore negation of the condition treated as an integer) is several times slower than bitwise...think that a conversion of LOGICAL to/from INTEGER (if it exists at..., if there's a difference) LOGICAL(anInt) == .true. ! if anInt is not...anything else on those other two integer styles. Weighing the alternatives gives ...
Show full article (4.04Kb) · Show article thread
1 · 2 · 3 · 4 · 5 · next