Browse Prior Art Database

Integer Variable Test

IP.com Disclosure Number: IPCOM000080491D
Original Publication Date: 1973-Dec-01
Included in the Prior Art Database: 2005-Feb-27
Document File: 1 page(s) / 11K

Publishing Venue

IBM

Related People

Schreiber, DE: AUTHOR

Abstract

This is a method to test whether an integer variable is odd or even from a higher level language such as FORTRAN.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 100% of the total text.

Page 1 of 1

Integer Variable Test

This is a method to test whether an integer variable is odd or even from a higher level language such as FORTRAN.

Often it is necessary to test an integer variable "I" to see whether it is odd or even by inspecting the lowest bit in the integer. While there are no explicit instructions to permit bit testing from FORTRAN, and other higher level languages, such as PL1, the following sequence of instructions permits determination whether ""I" is odd or even directly in line from FORTRAN in one machine cycle, without the use of bit manipulation subroutines: LOGICAL IL, ITEST DATA ITEST/Z00000001/ EQUIVALENCE (I, IL) IL = IL .AND. ITEST IF ( I .EQ. 0) GO TO.

1