2 int real

80 %
20 %
Information about 2 int real
Education

Published on March 9, 2014

Author: fyjordan9

Source: slideshare.net

General Fortran Program Heading Specification part Execution part Subprogram part End

Data Types Integer: Whole numbers. No decimal point or comma 0 5 -1 +102 (Valid) 8,765 16.0 (Invalid) Real: Represent a larger range of values (a) Decimal Representation: decimal point allowed but no comma 22.205 -31.2 +102.01 (b) Exponential Representation: integer or decimal number followed by an exponent written as the letter E with an integer constant following 226.23 2.2623E2 226.23E0 22623E-2

Data Types Character: used to represent letters, digits, and symbols. Ex: ‘A’, ‘a’, ‘9’, …… characters are enclosed between single quotes. Character Strings: A sequence of characters Ex: ‘PHYSICS’ , “PHYSICS” , ‘PHYS303’ valid strings ‘PHYSICS” , “PHYSICS’ invalid strings.

Variables    A variable is a name representing a memory location(s). Variable names must begin with a letter, which may be followed by up to 30 LETTERS, DIGITS, and UNDERSCORES. Ex: Area_of_Circle , CS073 ‘Valid’ PHYS 303 ‘ Invalid, no spaces allowed ’ 5inch ‘ Invalid, should start with letter ’ PHYS-303 ‘Invalid, use underscores not minus sign’ No distinction is made between UPPER or lower case. Area_of Circle, area_of_circle, AREA_OF_CIRCLE refer to the same variable.

Variable Declaration type_specifier :: list Ex: Real :: Radius, Area Integer :: No_of_Students Character :: initial Character(LEN =15) :: First_Name, Last_Name Character(15) :: First_Name, Last_Name Character(15) :: First_Name, Last_Name*20, initial*1

Variable Initialization In Fortran variables are not initialized when declared. Some compilers initialize variables to 0. To be on the safe side it always a good practice to initialize the variables once you declare them. Ex: Real :: length = 1.0, width = 0.5 Integer :: length = 2, width = 1 Sometimes we might want to declare a value that is constant and will not change throughout the program, like pi in the circle example. To initialize it use the parameter keyword Ex: Real, Parameter :: pi = 3.141593 If you attempt to change the value of pi, you will get a compile error

Variable Initialization In Fortran variables are not initialized when declared. Some compilers initialize variables to 0. To be on the safe side it always a good practice to initialize the variables once you declare them. Ex: Real :: length = 1.0, width = 0.5 Integer :: length = 2, width = 1 Sometimes we might want to declare a value that is constant and will not change throughout the program, like pi in the circle example. To initialize it use the parameter keyword Ex: Real, Parameter :: pi = 3.141593 If you attempt to change the value of pi, you will get a compile error

Add a comment

Related presentations

Related pages

International - Int. Real Estate

Int. Real-Estate Asset-Management and Planning & Verwertungs- und Liegenschaftsgeschäfte Inhaber: R.Söllner Büro: Tel : +49 9431 / 799 59 -80, Projekte ...
Read more

Datentyp – Wikipedia

int: Operationen zero:-> int +: int ... Wertebereich: Meist 32 Bit (−2 31 …2 31-1), 16 Bit, 64 Bit; ... REAL: 48: 2,9·10 −39: 1,7·10 38: 11–12 ...
Read more

Integer (Datentyp) – Wikipedia

Ein Integer besteht in der Regel aus 8, 16, 32, 64 oder 128 Bits (also 1, 2, 4, 8 oder 16 Bytes) ... (16), int (32) und long (64 Bit) bezeichnet. In ...
Read more

PHP: intval - Manual

function int ($s){return(int) ... to get an integer from a division by 2, ... (or you could use real_escape_string)
Read more

cloud.int2.real.com

cloud.int2.real.com
Read more

Pascal - Datentyp REAL - Institut für Informatik

Bitanzahl n Wertebereich Genauigkeit REAL 48 2.9E-39 .. 1.7E38 11-12 Stellen SINGLE 32 1.5E ... Zusätzlich zu Int und Frac gibt es in ...
Read more

8.1. Der Datentyp int (Integer)

int: 2 Byte-32768 +32767 %d oder %i: long: 4 Byte-2147483648 +2147483647 %ld oder %li: Tabelle 8.2: Der Datentyp long im Vergleich mit int (16-Bit-Systemen)
Read more

Einfache Datentypen - TUD - Operating Systems

Wirkung: Liefert die Eulersche Zahl (ca. 2.718282). exp. REAL PROC exp (REAL CONST x) Wirkung: ... TEXT PROC text (REAL CONST real, INT CONST length, fracs)
Read more

REAL TO ***: Type conversion REAL TO ***: Type conversion

REAL_TO_***: Type conversion REAL_TO_***: Type conversion Submit Feedback Function description The function converts an input value of the REAL ...
Read more

CAST und CONVERT (Transact-SQL)

float- und real-Formate. Wenn expression den Datentyp float oder real aufweist, ... (CAST(s.SalesYTD AS int) AS char(20)) LIKE '2%'; GO ...
Read more