12.07.2015 Views

CAD in Civil Engineering - Baustatik-Info-Server

CAD in Civil Engineering - Baustatik-Info-Server

CAD in Civil Engineering - Baustatik-Info-Server

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Page 26 Computer Languages for Eng<strong>in</strong>eer<strong>in</strong>g - SS 13Operator CommentExample< less than x = 23 < 13 >>> .false.> .true.> greater x = 23 > 13 >>> .true.>= left shift of bits x = 23 >= 23 >>> .true.== equal x = 23 == 23 >>> .true./= non equal x = 23 /= 23 >>> .false.The result of a boolean expression like above are the boolean values .false. or .true.. To comb<strong>in</strong>ecompar<strong>in</strong>g expressions the follow<strong>in</strong>g logical operators can be used. 67Operator Comment Example.and. logical and x = 1 .lt. 2 .and. 2 .lt. 3 >>> .true..or. logical or x = 1 .lt. 2 .or. 2 .gr. 3 >>> .true..equ. logical or x = .true. >>> y = .false. >>> x .eqv. y >>> .false..nequ. logical or x = .true. >>> y = .false. >>> x .neqv. y >>> .true..not. logical not x = .not. (1 .lt. 2) >>> .false.The truth table for the AND operator ∧ is given as follows..true. ∧ .true. = .true. (2.1).true. ∧ .false. = .false..false. ∧ .true. = .false..false. ∧ .false. = .false.The truth table for the OR operator ∨ is given as follows..true. ∨ .true. = .true. (2.2).true. ∨ .false. = .true..false. ∨ .true. = .true..false. ∨ .false. = .false.2.7 File IO, Screen and KeyboardTo communicate with the program the two statements read and write are necessary. In the most simplecase we read the <strong>in</strong>put data from the keyboard and write the output data <strong>in</strong>to a console w<strong>in</strong>dow. A simpleoutput gives us the example helloworld, see section 2.2.6 To make expressions clear parenthesis should be used. A term with<strong>in</strong> a parenthesis is evaluated first and it’s result then isused <strong>in</strong> further evaluations outside the parenthesis. With parenthesis the order of the evaluation can be set.7 The logical operator .NEQV. implements the exclusive OR.E. Baeck

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!