WEEK2 - Week2 ClicktoeditMastersubtitlestyle BasicConcepts...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
Click to edit Master subtitle style  BIL106_WEEK2_2004 11 Week 2   Basic Concepts
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
 BIL106_WEEK2_2004 22 - Data types o There are five basic data types in fortran n 1) integer n 2) real n 3) complex n 4) character         n 5) logical Numerical-data types Strings of characters Logical data values Non- numerical data types
Background image of page 2
 BIL106_WEEK2_2004 33 Integers o An Integer is a whole number (positive, negative, or zero) and does not contain commas or a decimal point. Examples for valid integer numbers are: 1 137 -1126 +17735 the followings are the examples for valid integer number: 8,675 (Commas are not allowed in numerical constants) 26.0 (Integer constants may not contain decimal points) --5 (Only one algebraic sign is allowed) 7- (The algebraic sign must precede the string of digits.)
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
 BIL106_WEEK2_2004 44 Real o real  constant must contain a decimal point, but no commas are  allowed. Valid real constants are: 1.623 -0.03275 +55765.0 invalid real constants 15,627 (commas are not allowed in numerical constants.) 786     (Real constants must contain a decimal point.) a real constant can be represented by an exponential. An exponent  written as the letter E with an integer constant following. For example: 
Background image of page 4
 BIL106_WEEK2_2004 55 Complex o complex  number is represented as a pair of real (i.e., floating  point) numbers. The first component of the pair represents the real  part of the complex data object, and the second represents the  imaginary part. For example;                                 Z = a + i b                        NOTE: Since you don’t have enough background on complex numbers,  you are not responsible from complex numbers and its related examples.
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
 BIL106_WEEK2_2004 66 Character string o Character constants , also called  strings , are sequences of  symbols from the ANSI standard character set for Fortran. o The number of a character constant between double quotes is the  length  of the constant For example:    ”PDQ123-A”       (Character constant of length 8)                        ”John Q. Doe”    (Character constant of length 11)
Background image of page 6
 BIL106_WEEK2_2004 77 Logical type o An object of logical type has the value  true  or  false
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
 BIL106_WEEK2_2004 88 Identifiers o Names used to identify programs,  constants, variables,  etc . o Identifiers must begin with a letter o This can be followed by up to 30 letters,  digits, undescores o Be careful with the case: lower or upper  case  letters 
Background image of page 8
 BIL106_WEEK2_2004 99 Identifiers o Examples Current Decay_Rate pressure an_identifier_with_a_long_name the_best_program
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 36

WEEK2 - Week2 ClicktoeditMastersubtitlestyle BasicConcepts...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online