Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site watdaisy.UUCP Path: utzoo!watmath!watdaisy!gvcormack From: gvcormack@watdaisy.UUCP (Gordon V. Cormack) Newsgroups: net.lang Subject: Re: IF KICK-BACK GREATER THAN 10 AND LESS THAN 100 THEN ... Message-ID: <6761@watdaisy.UUCP> Date: Thu, 22-Nov-84 15:34:30 EST Article-I.D.: watdaisy.6761 Posted: Thu Nov 22 15:34:30 1984 Date-Received: Fri, 23-Nov-84 02:43:36 EST References: <440@ima.UUCP> <6172@mcvax.UUCP>, <1241@utah-gr.UUCP>, <1345@ihuxq.UUCP> Organization: U of Waterloo, Ontario Lines: 27 I am tired of people saying that this is the programmer's mistake. COBOL is wrong. Using the "rules of logic" gives the same result as everyday common sense: the opposite of what COBOL does. The rules of logic say the following: when you distribute a positive comparison like "less than" across a logical operator there is no problem. e.g. A less than b and c MEANS A less than b and A less than c However, if a negation is distributed across the logical operator, DeMorgan's theorem applies; AND is transformed to OR and vice versa. e.g. a not less than b and c MEANS (except in COBOL) a not less than b or a not less than c but COBOL interprets it as a not less than b and a not less than c An everyday example: Compare the meanings of: "I am not male and female" "I am not male or female" -- Gordon Cormack, University of Waterloo